SmartSoft Component-Developer API
|
Component management class. More...
#include <smartIComponent.h>
Public Member Functions | |
IComponent (const std::string &componentName) | |
Default constructor initializes the component with a given component-name. More... | |
virtual | ~IComponent ()=default |
Destructor. More... | |
virtual StatusCode | run (void)=0 |
Runs the SmartSoft framework within a component which includes handling intercomponent communication etc. More... | |
virtual void | signal_shutdown (void)=0 |
virtual StatusCode | blocking (const bool b)=0 |
Allow or abort and reject blocking calls in communication patterns of this component. More... | |
std::string | getName () const |
Returns the component name. More... | |
virtual ITimerManager * | getTimerManager ()=0 |
get timer-manager for registering timer-handlers More... | |
Public Member Functions inherited from Smart::ShutdownSubject | |
ShutdownSubject () | |
Default constructor. More... | |
virtual | ~ShutdownSubject () |
Default destructor. More... | |
Protected Member Functions | |
IComponent ()=delete | |
Protected Member Functions inherited from Smart::ShutdownSubject | |
virtual void | attach (IShutdownObserver *observer) |
Attach an IShutdownObserver instance. More... | |
virtual void | detach (IShutdownObserver *observer) |
Detach an IShutdownObserver instance. More... | |
virtual void | notify_sutdown () |
Notifies all attached IShutdownObserver instances about an upcoming shutdown. More... | |
Protected Attributes | |
std::string | componentName |
the internal component-name More... | |
bool | is_blocking |
the internal blocking flag More... | |
Component management class.
Every software-component must provide exactly one instance of an IComponent. This class provides the base infrastructure for a software-component. This base-infrastructure is shared among all component's subentities such as the component's client- and server-ports as well as the user-tasks.
The main thread of a component is used by this class to run() the SmartSoft framework. Therefore all user activities must be started before in separate threads. Further details can be found in the examples.
|
protecteddelete |
|
inline |
Default constructor initializes the component with a given component-name.
componentName | unique name of the whole component, which is used by the clients to address this server |
|
virtualdefault |
Destructor.
|
pure virtual |
Allow or abort and reject blocking calls in communication patterns of this component.
If blocking is set to false all blocking calls of all communication patterns of this component return with SMART_CANCELLED. This can be used to abort blocking calls of ALL communication patterns inside a component.
b | (blocking) true/false |
|
inline |
Returns the component name.
The component name is a read-only value that is set once at component startup. This name serves as a parent namespace for all component's communication ports.
|
pure virtual |
get timer-manager for registering timer-handlers
An instance of an ITimerManager is instantiated by an IComponent. An ITimerManager allows activation of ITimerHandler instances that are triggered (once or repeatedly) after a given time period.
|
pure virtual |
Runs the SmartSoft framework within a component which includes handling intercomponent communication etc.
This method is called in the main()-routine of a component after all initializations including activation of user threads are finished. Thypically the last code-line of the man function looks like this: "return component.run();".
|
pure virtual |
|
protected |
the internal component-name
|
protected |
the internal blocking flag