All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::st::Event Class Reference

A class to represent an event. More...

#include <Event.h>

Public Member Functions

Eventclone () const
 It returns a clone of this event. More...
 
std::string getId () const
 It returns the object identification. More...
 
te::gm::GeometrygetLocation () const
 It returns the location where the event happened. More...
 
void getObjects (std::vector< te::st::Object * > &output) const
 It returns the objects involved to the event. More...
 
te::dt::DateTimegetTime () const
 It returns the time when the event happened. More...
 
Eventoperator= (const Event &other)
 Copy assignment operator. More...
 
void setId (const std::string &id)
 It sets the object identification. More...
 
void setLocation (te::gm::Geometry *g)
 It sets the location where the event happened. More...
 
void setObjects (std::vector< te::st::Object * > &objs)
 It sets the objects involved to the event. More...
 
void setTime (te::dt::DateTime *t)
 It sets the time when the event happened. More...
 
virtual ~Event ()
 Virtual destructor. More...
 
Event Constructors
 Event (const std::string &id, te::dt::DateTime *t, te::gm::Geometry *g)
 Constructor. More...
 
 Event (const std::string &id, te::dt::DateTime *t, te::gm::Geometry *g, std::vector< te::st::Object * > objs)
 Constructor. More...
 
 Event (const Event &ts)
 Copy constructor. More...
 

Private Attributes

std::string m_id
 The identification of the event. More...
 
std::auto_ptr< te::gm::Geometrym_location
 The location where the event happened. More...
 
std::vector< te::st::Object * > m_objects
 The objects involved to the event. More...
 
std::auto_ptr< te::dt::DateTimem_time
 The time when the event happened. More...
 

Detailed Description

A class to represent an event.

An event is an individual episode with a definite beginning and end which can involve one or more objects.

See also
Object

Definition at line 59 of file Event.h.

Constructor & Destructor Documentation

te::st::Event::Event ( const std::string &  id,
te::dt::DateTime t,
te::gm::Geometry g 
)

Constructor.

Parameters
idThe identification of the event.
tThe time when the event happened.
gThe location where the event happened.
Note
It will take the ownership of the input pointers.

Definition at line 40 of file Event.cpp.

te::st::Event::Event ( const std::string &  id,
te::dt::DateTime t,
te::gm::Geometry g,
std::vector< te::st::Object * >  objs 
)

Constructor.

Parameters
idThe identification of the event.
tThe time when the event happened.
gThe location where the event happened.
objsThe objects involved to the event.
Note
It will take the ownership of the input pointers.
It will NOT take the ownership of the involved objects.

Definition at line 47 of file Event.cpp.

te::st::Event::Event ( const Event ts)

Copy constructor.

Definition at line 56 of file Event.cpp.

References m_location, m_objects, and m_time.

te::st::Event::~Event ( )
virtual

Virtual destructor.

Definition at line 129 of file Event.cpp.

Member Function Documentation

te::st::Event * te::st::Event::clone ( ) const

It returns a clone of this event.

Returns
A new event.
Note
The caller will take the ownership of the returned pointer.

Definition at line 83 of file Event.cpp.

std::string te::st::Event::getId ( ) const

It returns the object identification.

Returns
The object identification.

Definition at line 88 of file Event.cpp.

te::gm::Geometry * te::st::Event::getLocation ( ) const

It returns the location where the event happened.

Returns
A pointer to the location where the event happened.
Note
The caller will NOT take the ownership of the returned pointer.

Definition at line 108 of file Event.cpp.

void te::st::Event::getObjects ( std::vector< te::st::Object * > &  output) const

It returns the objects involved to the event.

Returns
A pointer to the objects involved to the event.
Note
The caller will NOT take the ownership of the output pointers.

Definition at line 118 of file Event.cpp.

te::dt::DateTime * te::st::Event::getTime ( ) const

It returns the time when the event happened.

Returns
A pointer to the time when the event happened.
Note
The caller will NOT take the ownership of the returned pointer.

Definition at line 98 of file Event.cpp.

te::st::Event & te::st::Event::operator= ( const Event other)

Copy assignment operator.

Definition at line 67 of file Event.cpp.

References te::common::FreeContents(), m_id, m_location, m_objects, and m_time.

void te::st::Event::setId ( const std::string &  id)

It sets the object identification.

Parameters
idThe object identification.

Definition at line 93 of file Event.cpp.

void te::st::Event::setLocation ( te::gm::Geometry g)

It sets the location where the event happened.

Parameters
tThe location where the event happened.
Note
It will take the ownership of the input pointer.

Definition at line 113 of file Event.cpp.

void te::st::Event::setObjects ( std::vector< te::st::Object * > &  objs)

It sets the objects involved to the event.

Parameters
objsThe objects involved to the event.
Note
It will NOT take the ownership of the input objects.

Definition at line 123 of file Event.cpp.

void te::st::Event::setTime ( te::dt::DateTime t)

It sets the time when the event happened.

Parameters
tThe time when the event happened.
Note
It will take the ownership of the input pointer.

Definition at line 103 of file Event.cpp.

Member Data Documentation

std::string te::st::Event::m_id
private

The identification of the event.

Definition at line 184 of file Event.h.

Referenced by operator=().

std::auto_ptr<te::gm::Geometry> te::st::Event::m_location
private

The location where the event happened.

Definition at line 186 of file Event.h.

Referenced by Event(), and operator=().

std::vector<te::st::Object*> te::st::Event::m_objects
private

The objects involved to the event.

Definition at line 187 of file Event.h.

Referenced by Event(), and operator=().

std::auto_ptr<te::dt::DateTime> te::st::Event::m_time
private

The time when the event happened.

Definition at line 185 of file Event.h.

Referenced by Event(), and operator=().


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