#include <ReceiverFactory.hpp>
Interface for receivers factories.
Is recommended (performance issues) to use Recycler<T> as in the following example:
class MyReceiver;
public:
private:
void do_release (Receiver* receiver) { a_receivers.
release (static_cast <MyReceiver*> (receiver)); }
};
In most of cases, is recommended to use an comm::ReceiverFactoryImpl instance with the receiver type used in our application.
- See also
- Receiver
-
ReceiverFactoryImpl
◆ ReceiverFactory()
anna::comm::ReceiverFactory::ReceiverFactory |
( |
const char * |
name | ) |
|
|
protected |
Constructor.
- Parameters
-
name | Logical name for this receivers factory. |
◆ asString()
std::string anna::comm::ReceiverFactory::asString |
( |
void |
| ) |
const |
|
inline |
Returns a string with relevant information for this instance.
- Returns
- string with relevant information for this instance.
83 std::string msg(
"anna::comm::ReceiverFactory { Name: ");
◆ asXML()
Returns a XML document with relevant information for this instance.
- Parameters
-
parent | XML node from which created data will depend on. |
- Returns
- a XML document with relevant information for this instance.
◆ create()
Receiver* anna::comm::ReceiverFactory::create |
( |
| ) |
|
|
noexcept |
Creates a receiver instance for this factory. Reuse resources when needed.
- Returns
- The new receiver instance.
- Warning
- All the receivers obtained shall be released by mean release.
◆ do_create()
virtual Receiver* anna::comm::ReceiverFactory::do_create |
( |
| ) |
|
|
protectedpure virtual |
Creates the receiver instance if no other reusable instance is found. This method is called from a critical section activated for this instance.
- Returns
- The new receiver instance.
- Warning
- All the receivers obtained shall be released by mean release.
◆ do_release()
virtual void anna::comm::ReceiverFactory::do_release |
( |
Receiver * |
receiver | ) |
|
|
protectedpure virtual |
Release the receiver provided. This method is called from a critical section activated for this instance.
- Parameters
-
The | receiver instance to be released. |
◆ getName()
const std::string& anna::comm::ReceiverFactory::getName |
( |
| ) |
const |
|
inline |
Returns the logical name for this receiver factory.
- Returns
- logical name for this receiver factory.
◆ release()
void anna::comm::ReceiverFactory::release |
( |
Receiver * |
receiver | ) |
|
Release the receiver instance provided.
- Returns
- The receiver instance to be released.
- Warning
- The parameter should have been obtained by mean create.
The documentation for this class was generated from the following file: