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

#include <ForbiddenEvent.hpp>

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

Public Types

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

Public Member Functions

virtual ForbiddenEventSharedPtr newForbiddenEventPtr (const EventSharedPtr &inStartTimeInterval, const EventSharedPtr &inEndTimeInterval, const std::list< EventSharedPtr > &inEvents, const TimingSharedPtr &inTiming=TimingSharedPtr(), const Value &inDuration=Value()) throw (Error)
 
virtual void create (Pointer &outPointer) throw (Error)
 

Detailed Description

Convenience class to create an ForbiddenEvent.

Definition at line 54 of file ForbiddenEvent.hpp.

Member Typedef Documentation

template<typename _Tp>
typedef SelfReferencing<Type>::Pointer torc::generic::FactoryType< _Tp >::Pointer
inherited

A pointer to an object of type Type

Definition at line 45 of file FactoryType.hpp.

template<typename _Tp>
typedef _Tp torc::generic::FactoryType< _Tp >::Type
inherited

A rename of the parameter type

Definition at line 40 of file FactoryType.hpp.

template<typename _Tp>
typedef SelfReferencing<Type>::WeakPointer torc::generic::FactoryType< _Tp >::WeakPointer
inherited

A weak pointer to an object of type Type

Definition at line 50 of file FactoryType.hpp.

Member Function Documentation

template<typename _Tp>
virtual void torc::generic::FactoryType< _Tp >::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
ForbiddenEventSharedPtr torc::generic::ForbiddenEvent::Factory::newForbiddenEventPtr ( const EventSharedPtr inStartTimeInterval,
const EventSharedPtr inEndTimeInterval,
const std::list< EventSharedPtr > &  inEvents,
const TimingSharedPtr inTiming = TimingSharedPtr(),
const Value inDuration = Value() 
)
throw (Error
)
virtual

Create a ForbiddenEvent.

Parameters
[in]inStartTimeIntervalPointer to start event/offsetEvent of timeInterval.
[in]inEndTimeIntervalPointer to end event/offsetEvent of timeInterval.
[in]inEventsList of events which are forbidden during a period of time specified by TimeInterval(StartTimeInterval and EndTimeInterval).
[in]inTimingPointer to parented object (Timing) [optional]. If not mentioned PathDelay will not be added to timing.
[in]inDurationDuration of timeInterval, if end event is absent [optional].
Returns
Pointer to created ForbiddenEvent.

Definition at line 36 of file ForbiddenEvent.cpp.

39  {
40  try {
41  ForbiddenEventSharedPtr newForbiddenEvent;
42  create(newForbiddenEvent);
43  newForbiddenEvent->setStartTimeInterval(inStartTimeInterval);
44  newForbiddenEvent->setEndTimeInterval(inEndTimeInterval);
45  newForbiddenEvent->setEvents(inEvents);
46  if(inDuration.getIsSet()) {
47  newForbiddenEvent->setDuration(inDuration);
48  }
49  if(inTiming) {
50  inTiming->addForbiddenEvent(newForbiddenEvent);
51  }
52  return newForbiddenEvent;
53  } catch(Error& e) {
54  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
55  throw;
56  }
57 }
virtual void create(Pointer &outPointer)
Definition: FactoryType.hpp:58
boost::shared_ptr< ForbiddenEvent > ForbiddenEventSharedPtr

+ Here is the call graph for this function:


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