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

ForbiddenEvent class lists events which are forbidden during a period of times which is specified by time interval. Time interval is used to describe an interval between two times. Times can be described by events or offset events. More...

#include <ForbiddenEvent.hpp>

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

Data Structures

class  Factory
 

Public Types

typedef VisitorType
< ForbiddenEvent
Visitor
 
typedef ForbiddenEvent Type
 
typedef boost::shared_ptr< TypePointer
 
typedef boost::weak_ptr< TypeWeakPointer
 

Public Member Functions

virtual void accept (BaseVisitor &inoutVisitor) throw (Error)
 
const EventSharedPtr getStartTimeInterval () const
 
void setStartTimeInterval (const EventSharedPtr &inSource)
 
const EventSharedPtr getEndTimeInterval () const
 
void setEndTimeInterval (const EventSharedPtr &inSource)
 
const Value getDuration () const
 
void setDuration (const Value &inValue)
 
void getEvents (std::list< EventSharedPtr > &outEvents) const
 
void setEvents (const std::list< EventSharedPtr > &inEvents)
 
void addEvent (const EventSharedPtr &inSource)
 
virtual ~ForbiddenEvent () throw ()
 
void setWeakThis (const WeakPointer &inWeakThis)
 
Pointer getSharedThis () const
 

Protected Member Functions

 ForbiddenEvent ()
 

Private Member Functions

 ForbiddenEvent (const ForbiddenEvent &source)
 
ForbiddenEventoperator= (const ForbiddenEvent &source)
 

Private Attributes

EventSharedPtr mStartTimeInterval
 
EventSharedPtr mEndTimeInterval
 
Value mDuration
 
std::list< EventSharedPtrmEvents
 

Friends

class FactoryType< ForbiddenEvent >
 

Detailed Description

ForbiddenEvent class lists events which are forbidden during a period of times which is specified by time interval. Time interval is used to describe an interval between two times. Times can be described by events or offset events.

Definition at line 40 of file ForbiddenEvent.hpp.

Member Typedef Documentation

typedef boost::shared_ptr<Type> torc::generic::SelfReferencing< ForbiddenEvent >::Pointer
inherited

Definition at line 36 of file SelfReferencing.hpp.

Definition at line 35 of file SelfReferencing.hpp.

Convenience class to visit an ForbiddenEvent.

Definition at line 47 of file ForbiddenEvent.hpp.

typedef boost::weak_ptr<Type> torc::generic::SelfReferencing< ForbiddenEvent >::WeakPointer
inherited

Definition at line 37 of file SelfReferencing.hpp.

Constructor & Destructor Documentation

torc::generic::ForbiddenEvent::~ForbiddenEvent ( )
throw (
)
virtual

Definition at line 125 of file ForbiddenEvent.cpp.

125 {}
torc::generic::ForbiddenEvent::ForbiddenEvent ( )
protected

Definition at line 122 of file ForbiddenEvent.cpp.

122  : Visitable(), SelfReferencing<ForbiddenEvent>(),
std::list< EventSharedPtr > mEvents
torc::generic::ForbiddenEvent::ForbiddenEvent ( const ForbiddenEvent source)
private

Member Function Documentation

void torc::generic::ForbiddenEvent::accept ( BaseVisitor inoutVisitor)
throw (Error
)
virtual

Implements torc::generic::Visitable.

Definition at line 59 of file ForbiddenEvent.cpp.

59  {
60  try {
61  runVisitor(*this, inoutVisitor);
62  } catch(Error& e) {
63  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
64  throw;
65  }
66 }
void runVisitor(_Tp &inoutVisited, BaseVisitor &inoutVisitor)
Definition: VisitorType.hpp:78

+ Here is the call graph for this function:

void torc::generic::ForbiddenEvent::addEvent ( const EventSharedPtr inSource)

Add an event to the list of events

Parameters
[in]inSourcePointer to event to be appended to

Definition at line 113 of file ForbiddenEvent.cpp.

113  {
114  try {
115  mEvents.push_back(inSource);
116  } catch(Error& e) {
117  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
118  throw;
119  }
120 }
std::list< EventSharedPtr > mEvents

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Value torc::generic::ForbiddenEvent::getDuration ( ) const
inline

Get the duration of timeInterval, if end event is absent.

Returns
Value duration of timeInterval, if end event is absent.

Definition at line 170 of file ForbiddenEvent.hpp.

170  {
171  return mDuration;
172 }
const EventSharedPtr torc::generic::ForbiddenEvent::getEndTimeInterval ( ) const
inline

Get the pointer to end event/offsetEvent of timeInterval

Returns
Pointer to end event/offsetEvent of timeInterval

Definition at line 162 of file ForbiddenEvent.hpp.

162  {
163  return mEndTimeInterval;
164 }
void torc::generic::ForbiddenEvent::getEvents ( std::list< EventSharedPtr > &  outEvents) const
inline

Get all the events of this forbiddenEvent.

Parameters
[out]outEventsList of events to be appended to

Definition at line 179 of file ForbiddenEvent.hpp.

179  {
180  outEvents.insert(outEvents.end(), mEvents.begin(), mEvents.end());
181 }
std::list< EventSharedPtr > mEvents
Pointer torc::generic::SelfReferencing< ForbiddenEvent >::getSharedThis ( ) const
inlineinherited

Get a shared pointer to this object. A valid pointer is returned if weakThis was set. Otherwise this returns a NULL pointer. For Vector types, the second scenario is an exception condition and should be treated as such.

Returns
A shared pointer to this object

Get a shared pointer to this object. A valid pointer is returned if weakThis was set. Otherwise this returns a NULL pointer. For Vector types, the second scenario is an exception condition and should be treated as such.

Parameters
[out]ptrSet to a shared pointer to this object
const EventSharedPtr torc::generic::ForbiddenEvent::getStartTimeInterval ( ) const
inline

Get the pointer to start event/offsetEvent of timeInterval

Returns
Pointer to start event/offsetEvent of timeInterval

Definition at line 154 of file ForbiddenEvent.hpp.

154  {
155  return mStartTimeInterval;
156 }
ForbiddenEvent& torc::generic::ForbiddenEvent::operator= ( const ForbiddenEvent source)
private
void torc::generic::ForbiddenEvent::setDuration ( const Value inValue)

Set the duration of timeInterval, if end event is absent.

Parameters
[in]inValueDuration of timeInterval, if end event is absent.

Definition at line 88 of file ForbiddenEvent.cpp.

88  {
89  mDuration = inValue;
90 }
void torc::generic::ForbiddenEvent::setEndTimeInterval ( const EventSharedPtr inSource)

Set the pointer to end event/offsetEvent of timeInterval

Parameters
[in]inSourcePointer to end event/offsetEvent of timeInterval

Definition at line 80 of file ForbiddenEvent.cpp.

80  {
81  mEndTimeInterval = inSource;
82 }
void torc::generic::ForbiddenEvent::setEvents ( const std::list< EventSharedPtr > &  inEvents)

Set all the events of this forbiddenEvent.

Parameters
[in]inEventsList of events to be appended to

Set all the events of this forbiddenEvent.

Parameters
[out]inEventsList of events to be appended to

Definition at line 97 of file ForbiddenEvent.cpp.

97  {
98  std::list<EventSharedPtr>::const_iterator it = inEvents.begin();
99  for(; it != inEvents.end(); it++) {
100  try {
101  addEvent(*it);
102  } catch(Error& e) {
103  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
104  }
105  }
106 }
void addEvent(const EventSharedPtr &inSource)

+ Here is the call graph for this function:

void torc::generic::ForbiddenEvent::setStartTimeInterval ( const EventSharedPtr inSource)

Set the pointer to start event/offsetEvent of timeInterval

Parameters
[in]inSourcePointer to start event/offsetEvent of timeInterval

Definition at line 72 of file ForbiddenEvent.cpp.

72  {
73  mStartTimeInterval = inSource;
74 }
void torc::generic::SelfReferencing< ForbiddenEvent >::setWeakThis ( const WeakPointer inWeakThis)
inlineinherited

Set a weak pointer to this object. This will be used later to get a shared pointer to this object from within other member methods if required. This should be called by the Factory creating the object.

Parameters
[in]weakThisA weak pointer to this object

Friends And Related Function Documentation

friend class FactoryType< ForbiddenEvent >
friend

Definition at line 41 of file ForbiddenEvent.hpp.

Field Documentation

Value torc::generic::ForbiddenEvent::mDuration
private

Definition at line 145 of file ForbiddenEvent.hpp.

EventSharedPtr torc::generic::ForbiddenEvent::mEndTimeInterval
private

Definition at line 144 of file ForbiddenEvent.hpp.

std::list<EventSharedPtr> torc::generic::ForbiddenEvent::mEvents
private

Definition at line 146 of file ForbiddenEvent.hpp.

EventSharedPtr torc::generic::ForbiddenEvent::mStartTimeInterval
private

Definition at line 143 of file ForbiddenEvent.hpp.


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