    

 ## On this page

  

 

 # Example Example.cpp

 Last update: 25.03.2026 

<a id="Example_8cpp-example"></a>Example helper functions.

```
//
// COPYRIGHT ANSYS. ALL RIGHTS RESERVED.
//
#include "Example.h"

namespace {
    ansys::dpf::DpfError
    LoadPlugin(const std::string &plugin,
        const std::string &pluginName)
    {
        std::string suffix;
        std::string prefix = "";
#ifdef __linux__
        suffix = ".so";
        prefix = "lib";
#else
        suffix = ".dll";
#endif

        std::string path_to_dll = prefix + plugin + suffix;
        char* mapdlName = (char*)path_to_dll.c_str();
        return ansys::dpf::core::loadDpfPlugin(mapdlName, pluginName);
    }
};

ansys::dpf::Examples::FuncPtrs &
ansys::dpf::Examples::GetExampleFuncs() {
    static FuncPtrs exampleFuncs;
    return exampleFuncs;
}

ansys::dpf::Examples::FuncNames &
ansys::dpf::Examples::GetExampleFuncsNames() {
    static FuncNames exampleFuncNames;
    return exampleFuncNames;
}

ansys::dpf::DpfError
ansys::dpf::Examples::LoadMAPDL()
{
    return LoadPlugin("mapdlOperatorsCore", "mapdl");
}
ansys::dpf::DpfError
ansys::dpf::Examples::LoadMESH()
{
    return LoadPlugin("meshOperatorsCore", "mesh");
}

```