ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ScriptInterface::ContextManager Class Reference

Manage object contexts. More...

#include <ContextManager.hpp>

Public Types

enum class  CreationPolicy { LOCAL , GLOBAL }
 Labels for context. More...
 

Public Member Functions

 ContextManager (std::shared_ptr< Communication::MpiCallbacks > const &callbacks, const Utils::Factory< ObjectHandle > &factory)
 
std::shared_ptr< ObjectHandlemake_shared (CreationPolicy policy, std::string const &name, const VariantMap &parameters)
 Get a new reference counted instance of a script interface by name.
 
std::shared_ptr< ObjectHandledeserialize (std::string const &state_)
 Get a new reference counted instance of a script interface from a serialized state.
 
std::string serialize (const ObjectHandle *o) const
 Serialize a script interface object into a binary representation.
 

Detailed Description

Manage object contexts.

This owns object contexts and allows for creation and serialization of objects preserving their context.

Definition at line 57 of file ContextManager.hpp.

Member Enumeration Documentation

◆ CreationPolicy

Labels for context.

Enumerator
LOCAL 

Corresponding to LocalContext.

GLOBAL 

Corresponding to GlobalContext.

Definition at line 63 of file ContextManager.hpp.

Constructor & Destructor Documentation

◆ ContextManager()

ScriptInterface::ContextManager::ContextManager ( std::shared_ptr< Communication::MpiCallbacks > const &  callbacks,
const Utils::Factory< ObjectHandle > &  factory 
)

Definition at line 56 of file ContextManager.cpp.

Member Function Documentation

◆ deserialize()

std::shared_ptr< ObjectHandle > ScriptInterface::ContextManager::deserialize ( std::string const &  state_)

Get a new reference counted instance of a script interface from a serialized state.

Definition at line 39 of file ContextManager.cpp.

References ScriptInterface::ObjectHandle::deserialize().

◆ make_shared()

std::shared_ptr< ObjectHandle > ScriptInterface::ContextManager::make_shared ( CreationPolicy  policy,
std::string const &  name,
const VariantMap parameters 
)

Get a new reference counted instance of a script interface by name.

Definition at line 33 of file ContextManager.cpp.

References ScriptInterface::Context::make_shared().

◆ serialize()

std::string ScriptInterface::ContextManager::serialize ( const ObjectHandle o) const

Serialize a script interface object into a binary representation.

Definition at line 49 of file ContextManager.cpp.

References ScriptInterface::ObjectHandle::context(), Utils::pack(), and ScriptInterface::ObjectHandle::serialize().


The documentation for this class was generated from the following files: