Many existing computational programs are written in the C++ programming language. Although it is possible to use Scientific Dataset
Managed Libraries directly from C++ code, this approach is not convenient because it requires many sophisticated type casts between native C++ arrays (e.g.
double *x =new double[100]) and .NET types (e.g.
cli::array).
We have developed a set of wrapper classes to make the use of SDS in C++ more convenient. The wrapper classes are located in the sds.h file that the installer places in the include subfolder of the main Scientific Dataset directory.
For example, here is some C++ code that uses SDS:
IntPtr pstr = Marshal::StringToHGlobalAnsi(safe_cast<String^>(dataset["series"].Metadata["tag"]));
strcpy(fmod_tag, static_cast<const char*>(pstr.ToPointer()));
Marshal::FreeHGlobal(pstr);
...
mplan[i+1].code = safe_cast<Variable<double>^>(sds["code"])[i];
The following example uses the wrapper classes and is shorter and clearer:
strcpy(fmod_tag, dataset.Variable("series").GetAttString("tag"));
...
mplan[i+1].code = sds.Value("code",i);
A brief reference on C++ Wrapper is available
here. You can also find some tutorials on using the C++ wrapper for SDS in the source code.