Used to store all class-related Information from the Instantiation-File. More...
#include <ClassElement.h>
Public Member Functions | |
ClassElement (AbstractDeviceClass *classRef) | |
virtual | ~ClassElement () |
virtual void | initialize (const std::string &xpath, ElementXML *classElement, ParserElementFactory &parserElementFactory) |
triggers the parsing of the xml-file-structures and initializes the class with all needed information | |
virtual boost::shared_ptr < EventConfigurationElement > | getEventConfigurationElementRef (const std::string &logicalEventName, const std::string &eventConfigurationName) const |
return a reference to a specific event-configuration | |
virtual const std::vector < boost::shared_ptr < LogicalEventElement > > & | getLogicalElementCol () const |
virtual AbstractDeviceClass * | getClassRef () const |
virtual const std::string & | getClassName () const |
virtual const EventMap & | getActiveEventMap () const |
return a map of all logical events, and their connected, active events | |
virtual std::vector < EventElementPointer > | getActiveEvents (const std::string &logicalEventName) const |
return a vector of all active events, connected to a single logical event | |
Protected Member Functions | |
ClassElement () | |
To allow easy mocking of this class. | |
Private Member Functions | |
void | loadEventsMappingElement (const std::string &xpath, ElementXML *classElement, ParserElementFactory &parserElementFactory) |
loads the XML-data of the events mapping element | |
void | loadLogicalEventElements (const std::string &xpath, ElementXML *eventsMappingElement, ParserElementFactory &parserElementFactory) |
loads the XML-data of the logical-event-elements | |
void | loadDeviceElements (const std::string &xpath, ElementXML *classElement, ParserElementFactory &parserElementFactory) |
loads the XML-data of the device-elements | |
void | connectEventConfigRefs () |
connects the event-config-links, defined the different devices to the concrete event-configurations. | |
void | fillActiveEventMap () |
fills the member activeEventMap_ with data | |
Private Attributes | |
std::vector< boost::shared_ptr < LogicalEventElement > > | logicalEventElementCol_ |
all logicalEvent-Elements which are connected to this class-element | |
std::vector< boost::shared_ptr < DeviceElement2 > > | deviceElementCol_ |
all device-Elements which are connected to this class-element | |
EventMap | activeEventMap_ |
AbstractDeviceClass * | classRef_ |
reference to the class-object which represents the FESA-class | |
bool | isInitialized_ |
true, when initialization of this object was finished successfully | |
bool | eventConfigRefsConnected_ |
is true, when connection of event-configs was done successfully |
Used to store all class-related Information from the Instantiation-File.
Definition at line 29 of file ClassElement.h.
fesa::ClassElement::ClassElement | ( | AbstractDeviceClass * | classRef | ) |
classRef | The class for which we are going to load the XML-data |
Definition at line 16 of file ClassElement.cpp.
fesa::ClassElement::~ClassElement | ( | ) | [virtual] |
Definition at line 27 of file ClassElement.cpp.
fesa::ClassElement::ClassElement | ( | ) | [protected] |
To allow easy mocking of this class.
Definition at line 22 of file ClassElement.cpp.
void fesa::ClassElement::connectEventConfigRefs | ( | ) | [private] |
connects the event-config-links, defined the different devices to the concrete event-configurations.
Definition at line 51 of file ClassElement.cpp.
References deviceElementCol_.
Referenced by initialize().
void fesa::ClassElement::fillActiveEventMap | ( | ) | [private] |
fills the member activeEventMap_ with data
Definition at line 143 of file ClassElement.cpp.
References activeEventMap_, and logicalEventElementCol_.
Referenced by initialize().
const EventMap & fesa::ClassElement::getActiveEventMap | ( | ) | const [virtual] |
return a map of all logical events, and their connected, active events
Definition at line 152 of file ClassElement.cpp.
References activeEventMap_, eventConfigRefsConnected_, and FesaErrorParserElementNotInitialized.
std::vector< EventElementPointer > fesa::ClassElement::getActiveEvents | ( | const std::string & | logicalEventName | ) | const [virtual] |
return a vector of all active events, connected to a single logical event
Definition at line 160 of file ClassElement.cpp.
References eventConfigRefsConnected_, FesaErrorLogicalEventNotFound, FesaErrorParserElementNotInitialized, and logicalEventElementCol_.
const std::string & fesa::ClassElement::getClassName | ( | ) | const [virtual] |
Definition at line 138 of file ClassElement.cpp.
References classRef_, and fesa::AbstractDeviceClass::getName().
AbstractDeviceClass * fesa::ClassElement::getClassRef | ( | ) | const [virtual] |
Definition at line 133 of file ClassElement.cpp.
References classRef_.
boost::shared_ptr< EventConfigurationElement > fesa::ClassElement::getEventConfigurationElementRef | ( | const std::string & | logicalEventName, | |
const std::string & | eventConfigurationName | |||
) | const [virtual] |
return a reference to a specific event-configuration
Definition at line 107 of file ClassElement.cpp.
References FesaErrorParserElementNotInitialized, FesaErrorTimingMappingNotConform, isInitialized_, and logicalEventElementCol_.
const std::vector< boost::shared_ptr< LogicalEventElement > > & fesa::ClassElement::getLogicalElementCol | ( | ) | const [virtual] |
Definition at line 125 of file ClassElement.cpp.
References eventConfigRefsConnected_, FesaErrorParserElementNotInitialized, and logicalEventElementCol_.
void fesa::ClassElement::initialize | ( | const std::string & | xpath, | |
ElementXML * | classElement, | |||
ParserElementFactory & | parserElementFactory | |||
) | [virtual] |
triggers the parsing of the xml-file-structures and initializes the class with all needed information
Definition at line 32 of file ClassElement.cpp.
References connectEventConfigRefs(), eventConfigRefsConnected_, FesaErrorXMLElementNotFound, fillActiveEventMap(), isInitialized_, loadDeviceElements(), and loadEventsMappingElement().
void fesa::ClassElement::loadDeviceElements | ( | const std::string & | xpath, | |
ElementXML * | classElement, | |||
ParserElementFactory & | parserElementFactory | |||
) | [private] |
loads the XML-data of the device-elements
Definition at line 85 of file ClassElement.cpp.
References fesa::ElementXML::childList_, classRef_, fesa::ParserElementFactory::createDeviceElement2(), fesa::DEVICE_ELEMENT_TAG, deviceElementCol_, fesa::AbstractDeviceClass::getDeviceFactory(), and fesa::GLOBAL_DEVICE_ELEMENT_TAG.
Referenced by initialize().
void fesa::ClassElement::loadEventsMappingElement | ( | const std::string & | xpath, | |
ElementXML * | classElement, | |||
ParserElementFactory & | parserElementFactory | |||
) | [private] |
loads the XML-data of the events mapping element
Definition at line 60 of file ClassElement.cpp.
References fesa::ElementXML::childList_, fesa::EVENTS_MAPPING_ELEMENT_TAG, and loadLogicalEventElements().
Referenced by initialize().
void fesa::ClassElement::loadLogicalEventElements | ( | const std::string & | xpath, | |
ElementXML * | eventsMappingElement, | |||
ParserElementFactory & | parserElementFactory | |||
) | [private] |
loads the XML-data of the logical-event-elements
Definition at line 73 of file ClassElement.cpp.
References fesa::ElementXML::childList_, fesa::ParserElementFactory::createLogicalEventElement(), and logicalEventElementCol_.
Referenced by loadEventsMappingElement().
EventMap fesa::ClassElement::activeEventMap_ [private] |
Definition at line 111 of file ClassElement.h.
Referenced by fillActiveEventMap(), and getActiveEventMap().
AbstractDeviceClass* fesa::ClassElement::classRef_ [private] |
reference to the class-object which represents the FESA-class
Definition at line 116 of file ClassElement.h.
Referenced by getClassName(), getClassRef(), and loadDeviceElements().
std::vector<boost::shared_ptr<DeviceElement2> > fesa::ClassElement::deviceElementCol_ [private] |
all device-Elements which are connected to this class-element
Definition at line 108 of file ClassElement.h.
Referenced by connectEventConfigRefs(), and loadDeviceElements().
bool fesa::ClassElement::eventConfigRefsConnected_ [private] |
is true, when connection of event-configs was done successfully
Definition at line 126 of file ClassElement.h.
Referenced by getActiveEventMap(), getActiveEvents(), getLogicalElementCol(), and initialize().
bool fesa::ClassElement::isInitialized_ [private] |
true, when initialization of this object was finished successfully
Definition at line 121 of file ClassElement.h.
Referenced by getEventConfigurationElementRef(), and initialize().
std::vector<boost::shared_ptr<LogicalEventElement> > fesa::ClassElement::logicalEventElementCol_ [private] |
all logicalEvent-Elements which are connected to this class-element
Definition at line 103 of file ClassElement.h.
Referenced by fillActiveEventMap(), getActiveEvents(), getEventConfigurationElementRef(), getLogicalElementCol(), and loadLogicalEventElements().