EventAnalysis
1.0.0
|
Interface for a class which produced data objects. More...
#include <ObjectProducer.h>
Classes | |
class | AlreadyDeclared |
Exception class for already declared objects. More... | |
class | BadCategory |
Exception class for bad object category. More... | |
class | BadName |
Exception class for bad object name. More... | |
struct | ProducedObject |
Descriptor structure for a produced object. More... | |
class | Representation |
Public Types | |
using | ProducedObjects = std::vector< ProducedObject > |
Type for container of produced objects. More... | |
Public Member Functions | |
ObjectProducer () | |
Constructor. More... | |
virtual | ~ObjectProducer () |
Destructor. More... | |
void | DeclareProducedObject (std::string name, ObjectCategory category, std::string alias, std::string store) |
Declare a produced objects. More... | |
const ProducedObjects & | GetProducedObjects () const |
Getter method for produced objects. More... | |
virtual std::vector< std::string > | FreeObjects (const std::vector< std::string > &objs, Memory::Status memStatus) |
Free the memory for given objects. More... | |
Protected Member Functions | |
ObjectProducer (const std::shared_ptr< Representation > &impl) | |
std::shared_ptr< Representation > & | GetRepresentation () |
Private Attributes | |
std::shared_ptr< Representation > | _repr |
Interface for a class which produced data objects.
This class provides the interface for declaring and retrieving the data objects produced by a derived class.
using EA::ObjectProducer::ProducedObjects = std::vector<ProducedObject> |
Type for container of produced objects.
EA::ObjectProducer::ObjectProducer | ( | ) |
Constructor.
|
inlinevirtual |
Destructor.
|
inlineprotected |
void EA::ObjectProducer::DeclareProducedObject | ( | std::string | name, |
ObjectCategory | category, | ||
std::string | alias, | ||
std::string | store | ||
) |
Declare a produced objects.
This method adds an object to the list of ones produced by the producer. The declaration fails if an object with the same name and store has already been declared or if one argument has a bad value (e.g. "" for name
or NONE for category
). In this case an exception is thrown.
name | The name of the object. |
category | The category of the object. |
alias | The alias of the object (can be ""). |
store | The store where the object is placed (can be ""). |
ObjectProducer::BadName | if the declaration fails due to a bad object name. |
ObjectProducer::BadCategory | if the declaration fails due to a bad object category. |
ObjectProducer::AlreadyDeclared | if the declaration fails due to the object being already declared. |
|
virtual |
Free the memory for given objects.
This method frees the memory occupied by the given objects, to deal with high memory pressure situations. The memStatus
parameter flags the urgency of the memory free operation; overrides can decide how to handle each case, but a Memory::Status::EXHAUSTED code should correspond to a complete release of object memory (as much as possible0.
objs | The list of objects whose memory can be freed. |
Reimplemented in EA::RootDataProvider.
|
inline |
Getter method for produced objects.
This method returns a container with descriptors for the objects that the class produces. The default implementation returns an empty container.
|
inlineprotected |
|
private |