#include <Gizzard.h>
Public Member Functions | |
Gizzard (const std::string &instanceName, int64_t fComm, bool useComm) | |
void | dbug (bool tf) |
virtual void | registerUsesPort (ccafeopq::PortInfo *pInfo) throw (ccafeopq::Exception) |
virtual void | registerUsesPort (const ::std::string &pName, const ::std::string &pType,::ccafeopq::TypeMap_shared props) throw ( ::ccafeopq::Exception ) |
virtual void | addProvidesPort (ccafeopq::Port *inPort, ccafeopq::PortInfo *name) throw (ccafeopq::Exception) |
::ccafeopq::Port * | getOpaquePort (const char *name, enum ccafeopq::ExceptionType &status) |
::ccafeopq::Port * | getOpaquePort (const ::std::string &name, enum ccafeopq::ExceptionType &status) |
::ccafeopq::Port * | getPort (const std::string &name, enum ccafeopq::ExceptionType &status) throw (ccafeopq::Exception) |
virtual void | releasePort (char *name) |
virtual void | releasePort (const std::string &name) throw (ccafeopq::Exception) |
virtual void | releasePort (const char *name) |
virtual ccafeopq::PortInfo * | createPortInfo (const std::string &name, const std::string &type, const std::map< std::string, std::string > &properties) throw (ccafeopq::Exception) |
virtual void | destroyPortInfo (ccafeopq::PortInfo *pi) |
virtual const char * | getComponentInstanceName () |
::ccafeopq::ComponentID_shared | getComponentID () |
virtual void | destroyComponentID (::ccafeopq::ComponentID_shared cid_) |
virtual void | addProvidesPort (ccafeopq::Port *, const std::string &pname, const std::string &ptype,::ccafeopq::TypeMap_shared t) throw ( ::ccafeopq::Exception ) |
virtual void | addProvidesPort (ccafeopq::Port *, const std::string &pname, const std::string &ptype) throw ( ::ccafeopq::Exception ) |
virtual ::ccafeopq::TypeMap_shared | createTypeMap () throw ( ::ccafeopq::Exception ) |
virtual ::ccafeopq::TypeMap_shared | getPortProperties (const ::std::string &Name) throw ( ::ccafeopq::Exception ) |
virtual void | setPortProperties (const ::std::string &Name,::ccafeopq::TypeMap_shared tm) throw ( ::ccafeopq::Exception ) |
virtual ::std::string | genUniquePortName (const ::std::string &baseName) throw ( ::ccafeopq::Exception ) |
::ccafeopq::TypeMap_shared | getPropertyMap () |
void | setPropertyMapData (::ccafeopq::TypeMap_shared tm) |
int | connectUsesPort (::ccafeopq::PortInfo *info,::ccafeopq::Port *up,::ccafeopq::PortInfo *fromPI, Gizzard *fromG) |
int | connectUsesPort (const ::std::string &userPortName,::ccafeopq::Port *up, const ::std::string &providerPortName, Gizzard *fromG) |
int | connectUsesPort (const ::std::string &pName,::ccafeopq::Port *up) |
int | disconnectProvidesPort (ConnectionID_ptr c) |
int | connectProvidesPort (ConnectionID_ptr c) |
::std::vector< ConnectionID_ptr > | getConnections () |
::std::vector< ConnectionID_ptr > | getUsesConnections () |
int | disconnectAllUsesPorts () |
int | disconnectUsesPort (int pindex) |
const ::std::vector < UserPortData > & | getUsesPortRegister () |
virtual int | unregisterUsesPort (const char *name) |
virtual void | unregisterUsesPort (const std::string &name) throw (ccafeopq::Exception) |
virtual int | unregisterUsesPort (char *name) |
virtual ::ccafeopq::Port * | removeProvidesPort (const char *name) |
virtual ::ccafeopq::Port * | removeProvidesPort (const std::string &name) throw (ccafeopq::Exception) |
bool | usesThisPortType (const std::string &typeToTest) |
bool | providesThisPortType (const std::string &typeToTest) |
::std::vector< ::std::string > | getUsesPortTypes () |
::std::vector< ::std::string > | getUsesPortNames () |
::std::vector< ::std::string > | getProvidesPortTypes () |
::std::vector< ::std::string > | getProvidesPortNames () |
virtual const ::std::vector < UserPortData > & | getUsesPorts () |
virtual const ::std::vector < ProviderPortData > & | getProvidesPorts () |
::std::vector< ::std::string > | getConnectionStrings () |
OpqConnectionEventService * | getOCES () |
void | initDelegates () |
void | addServicesHelper (::ccafeopq::ServicesHelper *sh) |
virtual void | addComponentChangedListener (ComponentChangedListener *l) |
void | fireComponentChangedEvent (ComponentChangedEvent *evt) |
void | setFrameData (std::map< std::string, void * > *fd) |
::ccafeopq::TypeMap_shared | getComponentInternalPropertyMap () |
bool | hasMPIComm (int64_t &fortranBorrowComm) |
Static Public Member Functions | |
::ccafeopq::TypeMap_shared | createTypeMapStatic () throw ( ::ccafeopq::Exception ) |
Private Member Functions | |
int | nextSerial () |
int | findIndex (::std::vector< ProviderPortData > &info, const std::string &name) |
int | findIndex (::std::vector< UserPortData > &info, const std::string &name) |
int | getNextCount () |
void | checkInternalServices (const ::std::string &name, const ::std::string &type) |
Private Attributes | |
bool | debug |
::ccafeopq::ComponentID_shared | cid |
::std::vector< ProviderPortData > | pData |
::std::vector< UserPortData > | uData |
::std::vector< ConnectionID_ptr > | cData |
int | serial |
::ccafeopq::TypeMap_shared | compPropertyMap |
int64_t | fortranMPIComm |
bool | hasComm |
OpqParameterPortFactory * | oppf |
OpqConnectionEventService * | oces |
::ccafeopq::SvcPortMap | opaqueDelegates |
::std::vector < ::ccafeopq::ServicesHelper * > | helpers |
::std::vector < ComponentChangedListener * > | cmptChgLsnrs |
::std::map< std::string, void * > * | frame |
Static Private Attributes | |
static bool | countInitDone |
static int | pnameCount |
Gizzard::Gizzard | ( | const std::string & | instanceName, | |
int64_t | fComm, | |||
bool | useComm | |||
) |
Build a Services core object, with name given for component and fortran form mpi communicator (or ignore fcomm and mpi if useComm is false).
int Gizzard::findIndex | ( | ::std::vector< ProviderPortData > & | info, | |
const std::string & | name | |||
) | [private] |
Search a vector of ProviderPortData for one with name.
int Gizzard::findIndex | ( | ::std::vector< UserPortData > & | info, | |
const std::string & | name | |||
) | [private] |
Search a vector of UserPortData for one with name.
void Gizzard::dbug | ( | bool | tf | ) | [inline] |
virtual void Gizzard::registerUsesPort | ( | ccafeopq::PortInfo * | pInfo | ) | throw (ccafeopq::Exception) [virtual] |
The PortInfo which presumably came from createPortInfo is the Services responsibility (i.e. it takes over the memory management from here on).
virtual void Gizzard::addProvidesPort | ( | ccafeopq::Port * | inPort, | |
ccafeopq::PortInfo * | name | |||
) | throw (ccafeopq::Exception) [virtual] |
Returns -1 if error. 0 otherwise. duplicate add is an error.
::ccafeopq::Port* Gizzard::getOpaquePort | ( | const char * | name, | |
enum ccafeopq::ExceptionType & | status | |||
) |
Just like getPort() except it returns a non-type-specific ccafeopq::Port. does not throw on missing ports.
::ccafeopq::Port* Gizzard::getPort | ( | const std::string & | name, | |
enum ccafeopq::ExceptionType & | status | |||
) | throw (ccafeopq::Exception) |
Just like getPort() except it returns a non-type-specific ccafeopq::Port.
virtual void Gizzard::releasePort | ( | char * | name | ) | [virtual] |
Undo the getPort.
virtual void Gizzard::releasePort | ( | const std::string & | name | ) | throw (ccafeopq::Exception) [virtual] |
Undo the getPort.
virtual void Gizzard::releasePort | ( | const char * | name | ) | [virtual] |
For ccafeopq::Services
virtual ccafeopq::PortInfo* Gizzard::createPortInfo | ( | const std::string & | name, | |
const std::string & | type, | |||
const std::map< std::string, std::string > & | properties | |||
) | throw (ccafeopq::Exception) [virtual] |
For the ccafeopq:: binding. basically useless otherwise.
virtual void Gizzard::destroyPortInfo | ( | ccafeopq::PortInfo * | pi | ) | [virtual] |
destroy a previously created PortInfo. kill it; not stored anywhere.
virtual const char* Gizzard::getComponentInstanceName | ( | ) | [virtual] |
Component instance name for this component.
::ccafeopq::ComponentID_shared Gizzard::getComponentID | ( | ) |
return the shared_ptr opaque id.
virtual void Gizzard::destroyComponentID | ( | ::ccafeopq::ComponentID_shared | cid_ | ) | [virtual] |
get rid of a ComponentID
::ccafeopq::TypeMap_shared Gizzard::getPropertyMap | ( | ) |
fetch a *copy* of the property data.
void Gizzard::setPropertyMapData | ( | ::ccafeopq::TypeMap_shared | tm | ) |
copy data from tm to internal map.
int Gizzard::connectUsesPort | ( | ::ccafeopq::PortInfo * | info, | |
::ccafeopq::Port * | up, | |||
::ccafeopq::PortInfo * | fromPI, | |||
Gizzard * | fromG | |||
) |
This was how the framework adds a UsesPort. Note that this is completely inaccessible from the component. DEPRECATED
int Gizzard::connectUsesPort | ( | const ::std::string & | userPortName, | |
::ccafeopq::Port * | up, | |||
const ::std::string & | providerPortName, | |||
Gizzard * | fromG | |||
) |
the connection call, less events.
int Gizzard::disconnectProvidesPort | ( | ConnectionID_ptr | c | ) |
Inform Gizzard that its provided Port is nolonger in use in this Connection.
int Gizzard::connectProvidesPort | ( | ConnectionID_ptr | c | ) |
Inform Gizzard that its provided Port is used in this Connection.
::std::vector< ConnectionID_ptr > Gizzard::getConnections | ( | ) |
Get all the connections that are attached to this Gizzard.
::std::vector< ConnectionID_ptr > Gizzard::getUsesConnections | ( | ) |
Get the connections that are used by this Gizzard.
int Gizzard::disconnectAllUsesPorts | ( | ) |
Remove all connections to this Gizzard.
int Gizzard::disconnectUsesPort | ( | int | pindex | ) |
In cases that are exceptional, this returns a number < 0, otherwise 0. if not uses port exist and connected return silently. if isActive, return -1. still need to be checked: if !fromPI==ups.providedPortInfo hurl rte; if !fromG==ups.providerGizzard hurl rte;
const ::std::vector< UserPortData >& Gizzard::getUsesPortRegister | ( | ) |
Answer with the UsesPort's that have been registered by the component holding this Services object. Same as getUsesPorts.
virtual int Gizzard::unregisterUsesPort | ( | const char * | name | ) | [virtual] |
Inform Ccaffeine that you no longer intend to use this Port. Returns -1 if error. 0 otherwise.
virtual void Gizzard::unregisterUsesPort | ( | const std::string & | name | ) | throw (ccafeopq::Exception) [virtual] |
Inform Ccaffeine that you no longer intend to use this Port. Returns -1 if error. 0 otherwise.
virtual int Gizzard::unregisterUsesPort | ( | char * | name | ) | [virtual] |
Notify the framework that a Port, previously registered by this component, is no longer desired.
virtual ::ccafeopq::Port* Gizzard::removeProvidesPort | ( | const char * | name | ) |
Notifies the framework that a previously exported Port is no longer available for use.
virtual ::ccafeopq::Port* Gizzard::removeProvidesPort | ( | const std::string & | name | ) | throw (ccafeopq::Exception) |
Notifies the framework that a previously exported Port is no longer available for use.
virtual const ::std::vector< UserPortData >& Gizzard::getUsesPorts | ( | ) | [virtual] |
Mental health methods not on the Services class... return a vector list of Uses PortInfos
virtual const ::std::vector< ProviderPortData >& Gizzard::getProvidesPorts | ( | ) | [virtual] |
return a vector list of Provides PortInfos
::std::vector< ::std::string> Gizzard::getConnectionStrings | ( | ) |
Return strings describing current connections. Vector returned may be empty but not null. Each string is using-instance uses-port providing-instance provided-port [ACTIVE] ACTIVE is present if an outstanding getPort (!isReleased). providing-instance may be FRAMEWORK if framework/gizzard provides the port.
void Gizzard::addServicesHelper | ( | ::ccafeopq::ServicesHelper * | sh | ) |
add binding specific helper for port 'service' connections.
bool Gizzard::debug [private] |
True if you want debugging info.
::ccafeopq::ComponentID_shared Gizzard::cid [private] |
Name of this instance. unique. Redundant with CmpBox, ComponentInfo, possibly other things. The thing is, we ned to put it someplace accessible via gizzard and none of those other things are.
::std::vector< ComponentChangedListener * > Gizzard::cmptChgLsnrs [private] |
Contains the ComponentChangedListeners
::std::map<std::string, void *>* Gizzard::frame [private] |
A registry for global string to void*. It is global to the instance of ConnectionFramework in which the Gizzard lives. it is forgotten when the gizzard is destroyed.