Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

IDEA::PslDatabaseImpl Class Reference
[PlanServer implementation base classes]

See PslDatabase for API documentation. More...

#include <PslDatabaseImpl.hh>

Inheritance diagram for IDEA::PslDatabaseImpl:

IDEA::PlasmaDatabaseImpl List of all members.

Public Methods

virtual ~PslDatabaseImpl ()
 Destructor.

void resetContent ()
const std::string & getAgentName () const
void setAgentName (const std::string &name)
const PslTokencreateToken (const PslDatabase *database, const PslTimeline *timeline, const PslPredicate *predicate, const Time &earliestStart, const Time &latestStart, const Time &earliestEnd, const Time &latestEnd, unsigned int externalTokenId, const TokenLocation &source, const std::string &comRelayName)
const PslTokengetToken (int uid)
void removeToken (const PslTokenImpl *token)
void removeVariable (const PslVariable *var)
PslConstantcreateConstant (const std::string &name, double value, const PslConstantType &type)
 Will create a constant by the name name with value value of type type. If a constant by the name name already exists with a different value and/or type this will raise an error. Will return the pointer to the (created) PslConstant.

PslObjectcreateObject (const PslDatabase *database, const PslObjectClass *objectClass, const std::string &objectName)
 Will create an instance of the object-class objectClass by the name objectName and return a pointer to this instance. Will return the existing instance of PslObject if it already exists by the name objectName.

const PslVariablecreateVariable (const PslDatabase *database, int lb, int ub, const std::string &name)
 Will create an instance of PslVariable of type int with lowerbound lb and upperbound ub.

const PslVariablecreateVariable (const PslDatabase *database, int value, const std::string &name)
const PslVariablecreateVariable (const PslDatabase *database, const PslDataType &type, const std::string &name)
const PslVariablecreateVariable (const PslDatabase *database, double lb, double ub, const std::string &name)
const PslVariablecreateVariable (const PslDatabase *database, double value, const std::string &name)
const PslVariablecreateVariable (const PslDatabase *database, const PslLabelSet *ls, const std::string &name)
const PslVariablecreateBoolVariable (const PslDatabase *database, const std::string &name)
const PslVariablegetVariable (int key)
 Will return the PslVariable instance whose key-value is equal to key if such an instance exists, otherwise returns a null-pointer.

PslConstantgetConstant (const std::string &name)
 Returns the PslConstant instance by the name name if it exists otherwise returns a null-pointer.

const PslModelManagergetModelManager ()
 Returns the PslModelManager instance associated with the invoking database.

const std::string & getName () const
 Returns the name of the invoking database.

PslObjectgetObject (const std::string &name)
 Returns the PslObject instance by the name name if it exists otherwise returns a null-pointer.

const PslObjectList getObjects ()
 Returns all the PslObject instances associated with the invoking database.

const PslVariablegetTimeVariable ()
 Returns the time-variable of the invoking database.

void setTime (const Time &time)
 Sets the time of the invoking database to time.

void setPendingMessages (bool value)
 Sets the variable indicating if there are pending-messages in a reactor (typically the reactive-planner) to value.

const PslTrueFalseVariablegetPendingMessageVariable () const
const Time getTime ()
 Returns the current time of the invoking database.

void lock (const std::string &location)
void unLock (const std::string &location)
virtual void print (std::ostream &os)
 Prints the content of the invoking database to os.

void setPrintFilter (PslOutputFilter *filter, bool deleteInstance)
virtual bool isConsistent ()=0
virtual void setActiveUpdate ()=0
 Set active update enables the database to be populated with plan-server datastructures in real time they show up in the underlying database.

virtual void setPassiveUpdate ()=0
 Set active update disables the database to be populated with plan-server datastructures in real time they show up in the underlying database.

virtual int externalize (const PslToken *token)
const PslTokengetExternalizedToken (int id)

Protected Methods

 PslDatabaseImpl (const PslModelManager *modelManager, const std::string &agentName, const std::string &name)
 Constructor, requires a model-manager to be passed to the data-base.

const PslTokenaddToken (PslTokenImpl *impl)
 Creates a PslToken with implementation impl and adds the token into the token-container using the PslToken::getId as a key.

const PslVariableaddVariable (PslVariableImpl *impl)

Private Types

typedef std::map< std::string,
PslConstant * > 
String2Constant
typedef std::map< std::string,
PslObject * > 
String2Object
typedef std::map< int, PslVariable * > Int2PslVariable
typedef std::map< int, PslToken * > Int2PslToken

Private Methods

virtual void archive (const Time &t)=0
virtual const Time getTimeExtended ()
void initialize (const PslDatabase *database)
virtual void initializeExtended (const PslDatabase *database)
void createTimeVariable (const PslDatabase *database)
 Creates a variable for tracking current time.

void createPendingMessagesVariable (const PslDatabase *database)
 Creates a variable for tracking if there are pending messages in the queue for the database.


Private Attributes

String2Constant m_Constants
String2Object m_Objects
const PslModelManagerm_ModelManager
std::string m_Name
std::string m_AgentName
Int2PslVariable m_Variables
Int2PslToken m_Tokens
const PslVariablem_TimeVariable
PslTrueFalseVariablem_PendingMessageVariable
RecursiveThreadMutex m_Mutex
bool m_DeleteFilter
PslOutputFilterm_PrintFilter

Friends

class PslDatabase

Detailed Description

See PslDatabase for API documentation.


Member Typedef Documentation

typedef std::map< int, PslToken* > IDEA::PslDatabaseImpl::Int2PslToken [private]
 

typedef std::map< int, PslVariable* > IDEA::PslDatabaseImpl::Int2PslVariable [private]
 

typedef std::map< std::string, PslConstant* > IDEA::PslDatabaseImpl::String2Constant [private]
 

typedef std::map< std::string, PslObject* > IDEA::PslDatabaseImpl::String2Object [private]
 


Constructor & Destructor Documentation

IDEA::PslDatabaseImpl::~PslDatabaseImpl   [virtual]
 

Destructor.

IDEA::PslDatabaseImpl::PslDatabaseImpl const PslModelManager   modelManager,
const std::string &    agentName,
const std::string &    name
[protected]
 

Constructor, requires a model-manager to be passed to the data-base.


Member Function Documentation

const PslToken * IDEA::PslDatabaseImpl::addToken PslTokenImpl   impl [protected]
 

Creates a PslToken with implementation impl and adds the token into the token-container using the PslToken::getId as a key.

Warning:
Overrides any token using the same key

const PslVariable * IDEA::PslDatabaseImpl::addVariable PslVariableImpl   impl [protected]
 

virtual void IDEA::PslDatabaseImpl::archive const Time   t [private, pure virtual]
 

Implemented in IDEA::PlasmaDatabaseImpl.

const PslVariable * IDEA::PslDatabaseImpl::createBoolVariable const PslDatabase   database,
const std::string &    name
 

PslConstant * IDEA::PslDatabaseImpl::createConstant const std::string &    name,
double    value,
const PslConstantType   type
 

Will create a constant by the name name with value value of type type. If a constant by the name name already exists with a different value and/or type this will raise an error. Will return the pointer to the (created) PslConstant.

PslObject * IDEA::PslDatabaseImpl::createObject const PslDatabase   database,
const PslObjectClass   objectClass,
const std::string &    objectName
 

Will create an instance of the object-class objectClass by the name objectName and return a pointer to this instance. Will return the existing instance of PslObject if it already exists by the name objectName.

void IDEA::PslDatabaseImpl::createPendingMessagesVariable const PslDatabase   database [private]
 

Creates a variable for tracking if there are pending messages in the queue for the database.

void IDEA::PslDatabaseImpl::createTimeVariable const PslDatabase   database [private]
 

Creates a variable for tracking current time.

const PslToken * IDEA::PslDatabaseImpl::createToken const PslDatabase   database,
const PslTimeline   timeline,
const PslPredicate   predicate,
const Time   earliestStart,
const Time   latestStart,
const Time   earliestEnd,
const Time   latestEnd,
unsigned int    externalTokenId,
const TokenLocation   source,
const std::string &    comRelayName
 

const PslVariable * IDEA::PslDatabaseImpl::createVariable const PslDatabase   database,
const PslLabelSet   ls,
const std::string &    name
 

const PslVariable * IDEA::PslDatabaseImpl::createVariable const PslDatabase   database,
double    value,
const std::string &    name
 

const PslVariable * IDEA::PslDatabaseImpl::createVariable const PslDatabase   database,
double    lb,
double    ub,
const std::string &    name
 

const PslVariable * IDEA::PslDatabaseImpl::createVariable const PslDatabase   database,
const PslDataType   type,
const std::string &    name
 

const PslVariable * IDEA::PslDatabaseImpl::createVariable const PslDatabase   database,
int    value,
const std::string &    name
 

const PslVariable * IDEA::PslDatabaseImpl::createVariable const PslDatabase   database,
int    lb,
int    ub,
const std::string &    name
 

Will create an instance of PslVariable of type int with lowerbound lb and upperbound ub.

int IDEA::PslDatabaseImpl::externalize const PslToken   token [virtual]
 

const std::string & IDEA::PslDatabaseImpl::getAgentName  
 

PslConstant * IDEA::PslDatabaseImpl::getConstant const std::string &    name
 

Returns the PslConstant instance by the name name if it exists otherwise returns a null-pointer.

const PslToken * IDEA::PslDatabaseImpl::getExternalizedToken int    id
 

const PslModelManager * IDEA::PslDatabaseImpl::getModelManager  
 

Returns the PslModelManager instance associated with the invoking database.

const std::string & IDEA::PslDatabaseImpl::getName  
 

Returns the name of the invoking database.

PslObject * IDEA::PslDatabaseImpl::getObject const std::string &    name
 

Returns the PslObject instance by the name name if it exists otherwise returns a null-pointer.

const PslObjectList IDEA::PslDatabaseImpl::getObjects  
 

Returns all the PslObject instances associated with the invoking database.

const PslTrueFalseVariable * IDEA::PslDatabaseImpl::getPendingMessageVariable  
 

const Time IDEA::PslDatabaseImpl::getTime  
 

Returns the current time of the invoking database.

The current time is the time set last by the invocation setTime and is not necesarry related to the actual time of the agent.

const Time IDEA::PslDatabaseImpl::getTimeExtended   [private, virtual]
 

Reimplemented in IDEA::PlasmaDatabaseImpl.

const PslVariable * IDEA::PslDatabaseImpl::getTimeVariable  
 

Returns the time-variable of the invoking database.

It is recommended to use getTime and setTime to manipulate the variable. API has been exposed so the variable can be passed on to constraints

const PslToken * IDEA::PslDatabaseImpl::getToken int    uid
 

const PslVariable * IDEA::PslDatabaseImpl::getVariable int    key
 

Will return the PslVariable instance whose key-value is equal to key if such an instance exists, otherwise returns a null-pointer.

void IDEA::PslDatabaseImpl::initialize const PslDatabase   database [private]
 

void IDEA::PslDatabaseImpl::initializeExtended const PslDatabase   database [private, virtual]
 

Reimplemented in IDEA::PlasmaDatabaseImpl.

virtual bool IDEA::PslDatabaseImpl::isConsistent   [pure virtual]
 

Implemented in IDEA::PlasmaDatabaseImpl.

void IDEA::PslDatabaseImpl::lock const std::string &    location
 

void IDEA::PslDatabaseImpl::print std::ostream &    os [virtual]
 

Prints the content of the invoking database to os.

Reimplemented in IDEA::PlasmaDatabaseImpl.

void IDEA::PslDatabaseImpl::removeToken const PslTokenImpl   token
 

void IDEA::PslDatabaseImpl::removeVariable const PslVariable   var
 

void IDEA::PslDatabaseImpl::resetContent  
 

virtual void IDEA::PslDatabaseImpl::setActiveUpdate   [pure virtual]
 

Set active update enables the database to be populated with plan-server datastructures in real time they show up in the underlying database.

When invoked it should update the plan-server to be in synch with underlying data-structure again.

Implemented in IDEA::PlasmaDatabaseImpl.

void IDEA::PslDatabaseImpl::setAgentName const std::string &    name
 

virtual void IDEA::PslDatabaseImpl::setPassiveUpdate   [pure virtual]
 

Set active update disables the database to be populated with plan-server datastructures in real time they show up in the underlying database.

Implemented in IDEA::PlasmaDatabaseImpl.

void IDEA::PslDatabaseImpl::setPendingMessages bool    value
 

Sets the variable indicating if there are pending-messages in a reactor (typically the reactive-planner) to value.

void IDEA::PslDatabaseImpl::setPrintFilter PslOutputFilter   filter,
bool    deleteInstance
 

set a filter for use by print()

void IDEA::PslDatabaseImpl::setTime const Time   time
 

Sets the time of the invoking database to time.

Time is assumed to be monotonicly increasing so any invocation with time < getTime() will be ignored.

void IDEA::PslDatabaseImpl::unLock const std::string &    location
 


Friends And Related Function Documentation

friend class PslDatabase [friend]
 


Member Data Documentation

std::string IDEA::PslDatabaseImpl::m_AgentName [private]
 

String2Constant IDEA::PslDatabaseImpl::m_Constants [private]
 

bool IDEA::PslDatabaseImpl::m_DeleteFilter [private]
 

const PslModelManager* IDEA::PslDatabaseImpl::m_ModelManager [private]
 

RecursiveThreadMutex IDEA::PslDatabaseImpl::m_Mutex [private]
 

std::string IDEA::PslDatabaseImpl::m_Name [private]
 

String2Object IDEA::PslDatabaseImpl::m_Objects [private]
 

PslTrueFalseVariable* IDEA::PslDatabaseImpl::m_PendingMessageVariable [private]
 

PslOutputFilter* IDEA::PslDatabaseImpl::m_PrintFilter [private]
 

const PslVariable* IDEA::PslDatabaseImpl::m_TimeVariable [private]
 

Int2PslToken IDEA::PslDatabaseImpl::m_Tokens [private]
 

Int2PslVariable IDEA::PslDatabaseImpl::m_Variables [private]
 


Contact information
© IDEA
Generated on Fri Feb 3 17:09:47 2006 for IDEA.