This is the base class for all the others that define objects that may be used in a dynamic system.
Inheritance:
Public Methods
-
CDSLibComponent()
- Constructor
-
CDSLibComponent(const CDSLibComponent* pDSLibComponent, const CDSLibComponent* pContainer = NULL)
- Copy-constructor.
-
virtual ~CDSLibComponent()
- Destructor
-
virtual bool AcceptsContainer(const CDSLibComponent* pContainer) = 0
- Implementations must set the parameter as the container and return true, if it is a suitable container.
-
virtual bool AddComponent(CDSLibComponent* pComponent)
- Tries to add the parameter as a component of this container.
-
bool AllArrange()
- Performs top-down (from containers to components) calls of Arrange().
-
void AllGenerateCode(const std::string &strTemplatesPath, CCodeSection* pCodeSection) const
- Performs a code generation for this component and all its contained components in a top-down fashion (from containers to components).
-
virtual bool AllRepeatedValue(const CDSLibComponent* pCaller, const std::string & strValueName, const std::string & strValue) const
- THE REPEATED-VALUES CHECK IS NOT PERFORMED YET IN DSLib v2 AND MAY BE REMOVED
-
void AllReportMessages(CMessages* pMessagesReport)
- Adds the messages of every contained component to the parameter in a bottom-up fashion (from components to container).
-
virtual std::string Class() const = 0
- Must return the name of the class
-
virtual CDSLibComponent* Clone( const CDSLibComponent* pContainer = NULL) const = 0
- Must return an object copied from this one, using the specific copy-constructor of the class.
-
const CDSLibComponent* Component(const std::string & strIdentifier, const std::string & strClass) const
- Returns the first of the directly-contained components that is of the class and has the identifier specified in the arguments.
-
const CDSLibComponentPointers& Components() const
- Returns the list of components directly contained by this one
-
const CDSLibComponent* Container( const std::string & strClass = "", unsigned int uSkip = 0) const
- Returns the closest container of this component (searching bottom-up) of a specified class or base class, skipping a number of containers at the begining.
-
void DeleteObjects()
- Deletes all the components (objects) contained by this one in a bottom-up fashion.
-
virtual bool DescendantOf(const std::string & strClass) const
- Return if the argument is the class of this component or one of its base classes.
-
const std::string& Identifier() const
- Returns the identifier of this component
-
int ComponentIndex() const
- Returns the position of the pointer to this object in the list of components of its container.
-
const CMessages& Messages() const
- Returns the messages report of this component
-
virtual bool RepeatedValue(const std::string &, const std::string &) const
- THE REPEATED-VALUES CHECK IS NOT PERFORMED YET IN DSLib v2 AND MAY BE REMOVED
-
virtual std::string Value(const std::string & strValueName) const
- Returns a string to be inserted in the generated code instead of a <value > template command.
-
bool SetIdentifier(const std::string & strIdentifier)
- Sets the identifier of this component.
Protected Methods
-
virtual void AddMessage(unsigned int uNumber)
- Adds a message to this component's list.
-
virtual void Arrange()
- This function does nothing, but can be reimplemented to update the variables whose values depend on the container, just before the code generation
-
CDSLibComponentPointers& Components()
- Returns the list of directly-contained components
-
virtual void ComponentsGenerateCode(const std::string &strTemplatesPath, CCodeSection* pCodeSection) const
- Makes the contained components generate code for the section in the second argument, using the templates specified by the first argument.
-
virtual void GenerateCode(const std::string & strTemplatesPath, CCodeSection* pCodeSection) const = 0
- Makes this object and its contained objects generate code for the section in the second argument, using the templates specified by the first argumant.
-
std::string LongLongToString(long long llNumber) const
- Returns an integer number as a string.
-
CMessages& Messages()
- Returns the list of messages in this component
-
bool ParseTemplate(const std::string & strTemplatesPath, const std::string & strTemplate, CCodeSection* pOutputSection) const
- Makes this object and its contained objects generate code for the specified section, using the specified template.
-
void SetContainer(const CDSLibComponent* pContainer)
- Sets the container of this component.
-
long long StringToLongLong(const std::string &strNumber) const
- Returns an integer number contained in a string as a long long.
-
std::string DoubleToString(double dNumber) const
- Returns a real number as a string.
Documentation
This is the base class for all the others that define objects that
may be used in a dynamic system. It is a virtual class.
CDSLibComponent()
- Constructor
CDSLibComponent(const CDSLibComponent* pDSLibComponent, const CDSLibComponent* pContainer = NULL)
- Copy-constructor. Copies the attributes in CDSLibComponent. The lists
of contained components and messages are copy-constructed too, meaning
that all the contained components will be copied using Clone() function.
Any redefinition should invoke the copy-constructor of its base class.
- Parameters:
- pDSLibComponent - Object to copy from
pContainer - Container for this new object
virtual ~CDSLibComponent()
- Destructor
virtual bool AcceptsContainer(const CDSLibComponent* pContainer) = 0
- Implementations must set the parameter as the container and return
true, if it is a suitable container. If it is not, it must
generate the message NON_SUITABLE_CONTAINER_ERROR and return false.
- Parameters:
- pContainer - Container candidate
virtual bool AddComponent(CDSLibComponent* pComponent)
- Tries to add the parameter as a component of this container. If the
argument already has a container, generates the message
EXTRA_CONTAINER_ERROR and returns false. If not, calls
AcceptsContainer(this) in the argument and returns the result. If this
failed, it also generates the message COMPONENT_REJECTED_CONTAINER_ERROR.
- Parameters:
- pComponent - New component for this container
bool AllArrange()
- Performs top-down (from containers to components) calls of Arrange().
It first invokes Arrange() in this object. If any message is generated,
returns false. If not, it invokes Components().Arrange(). If any message
is generated, returns fase. Otherwise, true.
void AllGenerateCode(const std::string &strTemplatesPath, CCodeSection* pCodeSection) const
- Performs a code generation for this component and all its contained
components in a top-down fashion (from containers to components).
- Parameters:
- strTemplatesPath - Path to the template files to be parsed
pCodeSection - Code section to be generated. It must already point
to a CCodeSection object, which may be modified by adding new
sections and lines to it
virtual bool AllRepeatedValue(const CDSLibComponent* pCaller, const std::string & strValueName, const std::string & strValue) const
- THE REPEATED-VALUES CHECK IS NOT PERFORMED YET IN DSLib v2 AND MAY
BE REMOVED
void AllReportMessages(CMessages* pMessagesReport)
- Adds the messages of every contained component to the parameter in
a bottom-up fashion (from components to container). In every component,
once the messages are added to the parameter, they are removed from the
local list.
- Parameters:
- pMessagesReport - Messages report. Must point to an object, which
may be modified by adding new messages to it
virtual std::string Class() const = 0
- Must return the name of the class
virtual CDSLibComponent* Clone( const CDSLibComponent* pContainer = NULL) const = 0
- Must return an object copied from this one, using the specific
copy-constructor of the class. This should have the effect of cloning
all the member objects recursively.
- Parameters:
- pContainer - Container for the new object
const CDSLibComponent* Component(const std::string & strIdentifier, const std::string & strClass) const
- Returns the first of the directly-contained components that is of the
class and has the identifier specified in the arguments.
- Parameters:
- strIdentifier - Searched identifier
strClass - Searched class
const CDSLibComponentPointers& Components() const
- Returns the list of components directly contained by this one
const CDSLibComponent* Container( const std::string & strClass = "", unsigned int uSkip = 0) const
- Returns the closest container of this component (searching bottom-up)
of a specified class or base class, skipping a number of containers
at the begining.
- Parameters:
- strClass - Class or base class of the searched component
uSkip - Skip count to indicate where the search begins.
For example, if it is 1, it ignores the container and starts by
the container of the container (one containing level skipped). If it is
2, it ignores the container of the container too and starts by the
container of the container of the container (two containing levels
skipped). And so on
void DeleteObjects()
- Deletes all the components (objects) contained by this one in a
bottom-up fashion. It just calls Components().DeleteObjects().
virtual bool DescendantOf(const std::string & strClass) const
- Return if the argument is the class of this component or one of
its base classes.
- Parameters:
- strClass - Class name
const std::string& Identifier() const
- Returns the identifier of this component
int ComponentIndex() const
- Returns the position of the pointer to this object in the list of
components of its container. If there is no container or the pointer is
not in its vector, returns -1.
const CMessages& Messages() const
- Returns the messages report of this component
virtual bool RepeatedValue(const std::string &, const std::string &) const
- THE REPEATED-VALUES CHECK IS NOT PERFORMED YET IN DSLib v2 AND MAY
BE REMOVED
virtual std::string Value(const std::string & strValueName) const
- Returns a string to be inserted in the generated code instead of a
<value > template command.
- Parameters:
- strValueName - "name" argument of the template command
bool SetIdentifier(const std::string & strIdentifier)
- Sets the identifier of this component.
- Parameters:
- strIdentifier - Identifier
virtual void AddMessage(unsigned int uNumber)
- Adds a message to this component's list.
- Parameters:
- uNumber - Message number, as defined in "defines.h" file
virtual void Arrange()
- This function does nothing, but can be reimplemented to update the
variables whose values depend on the container, just before the code
generation
CDSLibComponentPointers& Components()
- Returns the list of directly-contained components
virtual void ComponentsGenerateCode(const std::string &strTemplatesPath, CCodeSection* pCodeSection) const
- Makes the contained components generate code for the section in
the second argument, using the templates specified by the first
argument.
- Parameters:
- strTemplatesPath - Path to the template files to be parsed
pCodeSection - Code section to be generated. It must already point
to a CCodeSection object, which may be modified by adding new sections
and lines to it
virtual void GenerateCode(const std::string & strTemplatesPath, CCodeSection* pCodeSection) const = 0
- Makes this object and its contained objects generate code for the
section in the second argument, using the templates specified by the
first argumant.
- Parameters:
- strTemplatesPath - Path to the template files to be parsed
pCodeSection - Code section to be generated. It must already point
to a CCodeSection object, which may be modified by adding new
sections and lines to it
std::string LongLongToString(long long llNumber) const
- Returns an integer number as a string.
- Parameters:
- llNumber - Number to be converted
CMessages& Messages()
- Returns the list of messages in this component
bool ParseTemplate(const std::string & strTemplatesPath, const std::string & strTemplate, CCodeSection* pOutputSection) const
- Makes this object and its contained objects generate code for the
specified section, using the specified template.
- Parameters:
- strTemplatesPath - Path to the template file to be parsed
strTemplate - Template file to be parsed
pCodeSection - Code section to be generated. It must already point
to a CCodeSection object, which may be modified by adding new
sections and lines to it
void SetContainer(const CDSLibComponent* pContainer)
- Sets the container of this component.
- Parameters:
- pContainer - New container
long long StringToLongLong(const std::string &strNumber) const
- Returns an integer number contained in a string as a long long.
- Parameters:
- strNumber - String containing an integer number
std::string DoubleToString(double dNumber) const
- Returns a real number as a string.
- Parameters:
- dNumber - Real number
- Direct child classes:
- CWriter
CVariable
CReader
CDynamicSystem
CBlock
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.