EventAnalysis  1.0.0
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
EA::ObjectProducer Class Reference

Interface for a class which produced data objects. More...

#include <ObjectProducer.h>

Inheritance diagram for EA::ObjectProducer:
EA::Algorithm EA::DataProvider EA::AlgoSequence EA::PersistenceAlgo EA::RootDataProvider EA::AlgoSequenceDecorator EA::GarbageCollectorDecorator

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 ProducedObjectsGetProducedObjects () 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
 

Detailed Description

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.

Member Typedef Documentation

◆ ProducedObjects

Type for container of produced objects.

Constructor & Destructor Documentation

◆ ObjectProducer() [1/2]

EA::ObjectProducer::ObjectProducer ( )

Constructor.

◆ ~ObjectProducer()

virtual EA::ObjectProducer::~ObjectProducer ( )
inlinevirtual

Destructor.

◆ ObjectProducer() [2/2]

EA::ObjectProducer::ObjectProducer ( const std::shared_ptr< Representation > &  impl)
inlineprotected

Member Function Documentation

◆ DeclareProducedObject()

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.

Parameters
nameThe name of the object.
categoryThe category of the object.
aliasThe alias of the object (can be "").
storeThe store where the object is placed (can be "").
Exceptions
ObjectProducer::BadNameif the declaration fails due to a bad object name.
ObjectProducer::BadCategoryif the declaration fails due to a bad object category.
ObjectProducer::AlreadyDeclaredif the declaration fails due to the object being already declared.

◆ FreeObjects()

std::vector< std::string > EA::ObjectProducer::FreeObjects ( const std::vector< std::string > &  objs,
Memory::Status  memStatus 
)
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.

Parameters
objsThe list of objects whose memory can be freed.
Returns
A list of objects whose memory has been released.
See also
#Memory::GetState

Reimplemented in EA::RootDataProvider.

◆ GetProducedObjects()

const ProducedObjects& EA::ObjectProducer::GetProducedObjects ( ) const
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.

Returns
The descriptors for the produced objects.

◆ GetRepresentation()

std::shared_ptr<Representation>& EA::ObjectProducer::GetRepresentation ( )
inlineprotected

Member Data Documentation

◆ _repr

std::shared_ptr<Representation> EA::ObjectProducer::_repr
private

The documentation for this class was generated from the following files: