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

#include <Apply.hpp>

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

Public Types

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

Public Member Functions

virtual ApplySharedPtr newApplyPtr (const int32_t &inNoOfCycle, const Value &inCycleDuration, const std::list< LogicalResponseSharedPtr > &inLogicResponces, const SimulateSharedPtr &inSimulate=SimulateSharedPtr()) throw (Error)
 
virtual void create (Pointer &outPointer) throw (Error)
 

Detailed Description

Convenience class to create apply .

Definition at line 53 of file Apply.hpp.

Member Typedef Documentation

A pointer to an object of type Type

Definition at line 45 of file FactoryType.hpp.

typedef Apply torc::generic::FactoryType< Apply >::Type
inherited

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< Apply >::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
ApplySharedPtr torc::generic::Apply::Factory::newApplyPtr ( const int32_t &  inNoOfCycle,
const Value inCycleDuration,
const std::list< LogicalResponseSharedPtr > &  inLogicResponces,
const SimulateSharedPtr inSimulate = SimulateSharedPtr() 
)
throw (Error
)
virtual

Create an apply.

Parameters
[in]inNoOfCycleint32_t No of cycles for this apply.
[in]inCycleDurationValue Duration of each cycle.
[in]inLogicResponcesList of LogicResponces.
[in]inSimulatePointer to parented (Simulate) object [optional]. If not mentioned apply will not be added to simulate.
Returns
Pointer to created apply.

Definition at line 34 of file Apply.cpp.

36  {
37  try {
38  ApplySharedPtr newApply;
39  create(newApply);
40  newApply->setNoOfCycle(inNoOfCycle);
41  newApply->setCycleDuration(inCycleDuration);
42  newApply->setLogicResponses(inLogicResponces);
43  if(inSimulate) {
44  inSimulate->addApply(newApply);
45  }
46  return newApply;
47  } catch(Error& e) {
48  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
49  throw;
50  }
51 }
virtual void create(Pointer &outPointer)
Definition: FactoryType.hpp:58
boost::shared_ptr< Apply > ApplySharedPtr

+ Here is the call graph for this function:


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