MemoryXController Class Reference

#include <MemoryX/gui-plugins/SceneEditor/memoryxcontroller/MemoryXController.h>

Public Member Functions

std::vector< std::string > getAllSnapshots ()
 Returns a list with the names of all existing snapshots. More...
 
controller::ControllerPtr getController () const
 Returns the main controller of this plugin. More...
 
std::shared_ptr< PriorKnowledgeControllergetPriorKnowlegdeController () const
 Returns a shared pointer to the PriorKnowledgeController. More...
 
IceInternal::Handle< WorkingMemoryControllergetWorkingMemoryController () const
 Returns a shared pointer to the WorkingMemoryController. More...
 
void init (const memoryx::PriorKnowledgeInterfacePrx &priorKnowledgePrx, const memoryx::WorkingMemoryInterfacePrx &workingMemoryPrx, const std::string &workingMemoryUpdatesTopic, const std::string &objectInstancesSegmentName, const memoryx::LongtermMemoryInterfacePrx &longtermMemoryPrx, const controller::ControllerPtr &mainController)
 Initialisates the MemoryXController. More...
 
std::vector< std::string > loadSnapshot (const std::string &snapshotName)
 Loads the content of the snapshot with the given name and add it to the current working memory. More...
 
 MemoryXController ()
 Constructor. More...
 
bool saveObjectsInSnapshot (std::string &snapshotName, const std::vector< std::string > &objectIds)
 Saves all object instances whose ids are given in a snapshot with the given name. More...
 
bool saveSceneInSnapshot (std::string &snapshotName)
 Saves the whole content of the working memory in a snapshot with the given name. More...
 
 ~MemoryXController ()
 Destructor. More...
 

Detailed Description

Definition at line 51 of file MemoryXController.h.

Constructor & Destructor Documentation

◆ MemoryXController()

Constructor.

Creates an instance of this class.

Definition at line 45 of file MemoryXController.cpp.

◆ ~MemoryXController()

Destructor.

Definition at line 50 of file MemoryXController.cpp.

Member Function Documentation

◆ getAllSnapshots()

std::vector< std::string > getAllSnapshots ( )

Returns a list with the names of all existing snapshots.

Returns
std::vector<std::string> list of names of all existing snapshots

Definition at line 155 of file MemoryXController.cpp.

◆ getController()

controller::ControllerPtr getController ( ) const

Returns the main controller of this plugin.

Returns
controller::ControllerPtr the pointer to the main controller

Definition at line 150 of file MemoryXController.cpp.

◆ getPriorKnowlegdeController()

std::shared_ptr< memoryxcontroller::PriorKnowledgeController > getPriorKnowlegdeController ( ) const

Returns a shared pointer to the PriorKnowledgeController.

Returns
std::shared_ptr<PriorKnowledgeController> the pointer to the PriorKnowledgeController

Definition at line 145 of file MemoryXController.cpp.

◆ getWorkingMemoryController()

IceInternal::Handle< memoryxcontroller::WorkingMemoryController > getWorkingMemoryController ( ) const

Returns a shared pointer to the WorkingMemoryController.

Returns
IceInternal::Handle<WorkingMemoryController> the pointer to the WorkingMemoryController

Definition at line 140 of file MemoryXController.cpp.

◆ init()

void init ( const memoryx::PriorKnowledgeInterfacePrx &  priorKnowledgePrx,
const memoryx::WorkingMemoryInterfacePrx &  workingMemoryPrx,
const std::string &  workingMemoryUpdatesTopic,
const std::string &  objectInstancesSegmentName,
const memoryx::LongtermMemoryInterfacePrx &  longtermMemoryPrx,
const controller::ControllerPtr mainController 
)

Initialisates the MemoryXController.

Parameters
priorKnowledgePrxthe proxy to the priorknowledge
workingMemoryPrxthe proxy to the working memory
workingMemoryUpdatesTopicthe name of the topic where changes of the working memory are reported
objectInstancesSegmentNamethe name of the segment in the working memory where the object instances are stored
longtermMemoryPrxthe proxy to the longtermmemory where snapshots are stored
mainControllerthe controller of this programm
See also
controller::Controller

Definition at line 58 of file MemoryXController.cpp.

◆ loadSnapshot()

std::vector< std::string > loadSnapshot ( const std::string &  snapshotName)

Loads the content of the snapshot with the given name and add it to the current working memory.

Returns a list with the ids of the added object instances. If there is no snapshot with the given name nothing is added to the working memory.

Parameters
snapshotNamethe name of the snapshot that should be loaded
Returns
std::vector<std::string> the list with the ids of the added object instances

Definition at line 105 of file MemoryXController.cpp.

◆ saveObjectsInSnapshot()

bool saveObjectsInSnapshot ( std::string &  snapshotName,
const std::vector< std::string > &  objectIds 
)

Saves all object instances whose ids are given in a snapshot with the given name.

Parameters
snapshotNamethe name of the snapshot
objectIdsthe list with the ids of the object instances that shold be saved
Returns
bool true when the saving was successful

Definition at line 88 of file MemoryXController.cpp.

+ Here is the call graph for this function:

◆ saveSceneInSnapshot()

bool saveSceneInSnapshot ( std::string &  snapshotName)

Saves the whole content of the working memory in a snapshot with the given name.

If the given name does not start with 'Snapshot_', this prefix will be added.

Parameters
snapshotNamethe name of the snapshot
Returns
bool true when the saving was successful

Definition at line 71 of file MemoryXController.cpp.

+ Here is the call graph for this function:

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