torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::LogicElement::Factory Class Reference

#include <LogicElement.hpp>

+ Inheritance diagram for torc::generic::LogicElement::Factory:
+ Collaboration diagram for torc::generic::LogicElement::Factory:

Public Types

typedef LogicElement Type
 
typedef SelfReferencing< Type >
::Pointer 
Pointer
 
typedef SelfReferencing< Type >
::WeakPointer 
WeakPointer
 

Public Member Functions

virtual LogicElementSharedPtr newLogicElementPtr (const LogicElement::Type &inType, const LogicValueSharedPtr &inLogicValue=LogicValueSharedPtr(), const LogicElementSharedPtr &inParentLogicElement=LogicElementSharedPtr()) throw (Error)
 
virtual void create (Pointer &outPointer) throw (Error)
 

Detailed Description

Convenience class to create a logic element.

Definition at line 72 of file LogicElement.hpp.

Member Typedef Documentation

A pointer to an object of type Type

Definition at line 45 of file FactoryType.hpp.

A rename of the parameter type

Definition at line 40 of file FactoryType.hpp.

A weak pointer to an object of type Type

Definition at line 50 of file FactoryType.hpp.

Member Function Documentation

virtual void torc::generic::FactoryType< LogicElement >::create ( Pointer outPointer)
throw (Error
)
inlinevirtualinherited

Create an object of the Type specification of Factory. If the object has a boost::weak_ptr to itself, it is the task of this method to set this after the object is created.

Returns
A pointer to the freshly created object.

Definition at line 58 of file FactoryType.hpp.

58  {
59  try {
60  Pointer temp(new _Tp()); //Do not remove
61  outPointer = temp;
62  WeakPointer weakPtr(outPointer);
63  outPointer->setWeakThis(weakPtr);
64  } catch(std::exception& e) //May receive std::bad_alloc
65  {
66  //TBD::ERROR
67  }
68  }
SelfReferencing< Type >::WeakPointer WeakPointer
Definition: FactoryType.hpp:50
SelfReferencing< Type >::Pointer Pointer
Definition: FactoryType.hpp:45
LogicElementSharedPtr torc::generic::LogicElement::Factory::newLogicElementPtr ( const LogicElement::Type inType,
const LogicValueSharedPtr inLogicValue = LogicValueSharedPtr(),
const LogicElementSharedPtr inParentLogicElement = LogicElementSharedPtr() 
)
throw (Error
)
virtual

Create a logic element.

Parameters
[in]inTypeType of the logic value.
[in]inLogicValuePointer to the logic value [optional], needed for single logic element creation.
[in]inParentLogicElementPointer to parent logic element [optional].
Returns
Pointer to created permutable.

Definition at line 32 of file LogicElement.cpp.

34  {
35  try {
36  LogicElementSharedPtr newLogicElement;
37  create(newLogicElement);
38  newLogicElement->setType(inType);
39  if(inLogicValue) {
40  newLogicElement->setName(inLogicValue->getName());
41  }
42  if(inParentLogicElement) {
43  inParentLogicElement->addChildLogicElement(newLogicElement);
44  }
45  return newLogicElement;
46  } catch(Error& e) {
47  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
48  throw;
49  }
50 }
boost::shared_ptr< LogicElement > LogicElementSharedPtr
virtual void create(Pointer &outPointer)
Definition: FactoryType.hpp:58

+ Here is the call graph for this function:


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