OSB_LIB::StatusRequests Class Reference

Collaboration diagram for OSB_LIB::StatusRequests:

Collaboration graph
[legend]
List of all members.

Detailed Description

List of status requests.

StatusRequests holds a list of StatusRequest that apply to the interval defined by period_.

If the list with the status requests is not empty, then the class provides enough information to determine the perferred status of the related entity for every time with the interval.

Definition at line 335 of file statusrequest.h.

Public Types

Public Member Functions

Private Attributes

Friends

Classes


Member Typedef Documentation

typedef Cont::const_iterator OSB_LIB::StatusRequests::ConstIter

Const iterator over the status requests.

Definition at line 361 of file statusrequest.h.

typedef Cont::const_reverse_iterator OSB_LIB::StatusRequests::ConstRiter

Const reverse iterator over the status requests.

Definition at line 363 of file statusrequest.h.

typedef std::set<StatusRequest, Cmp> OSB_LIB::StatusRequests::Cont

STL container to store the status requests.

They are sorted in ascending order of the valid-from date.

Definition at line 359 of file statusrequest.h.


Constructor & Destructor Documentation

OSB_LIB::StatusRequests::StatusRequests (  ) 

Empty default constructor.

Note:
The time period will be empty.

OSB_LIB::StatusRequests::StatusRequests ( const Period period  ) 

Constructor with time period to use.


Member Function Documentation

StatusRequests::ConstIter OSB_LIB::StatusRequests::begin (  )  const [inline]

Begin of status requests.

Definition at line 507 of file statusrequest.h.

References requests_.

Referenced by countIf().

template<typename Pred>
size_t OSB_LIB::StatusRequests::countIf ( Pred  pred  )  const [inline]

Count the requests using a predicate.

Definition at line 538 of file statusrequest.h.

References begin(), and end().

bool OSB_LIB::StatusRequests::empty (  )  const [inline]

List of status requests empty?

Definition at line 497 of file statusrequest.h.

References requests_.

StatusRequests::ConstIter OSB_LIB::StatusRequests::end (  )  const [inline]

End of status requests.

Definition at line 512 of file statusrequest.h.

References requests_.

Referenced by countIf().

const StatusRequest& OSB_LIB::StatusRequests::first (  )  const

Get request with the earliest valid-from date.

Exceptions:
OsbException if requests_ is empty.

const StatusRequest* OSB_LIB::StatusRequests::getReqStatus ( const OSB_LIB::DateTime ts  )  const

Get the requested status for a given time.

Parameters:
ts Date and time to use.
Returns:
The preferred status at time ts.
It is 0 if no status request with valid-from <= ts exists in requests_.
Note:
Only meaningful after the request were read for a period that includes ts.

const StatusRequest& OSB_LIB::StatusRequests::last (  )  const

Get the request with the greatest valid-from date.

Exceptions:
OsbException if requests_ is empty.

const Period& OSB_LIB::StatusRequests::period (  )  const

Time period covered by the status requests.

StatusRequests::ConstRiter OSB_LIB::StatusRequests::rbegin (  )  const [inline]

Begin of reversed status requests.

Definition at line 517 of file statusrequest.h.

References requests_.

StatusRequests::ConstRiter OSB_LIB::StatusRequests::rend (  )  const [inline]

End of reversed status requests.

Definition at line 522 of file statusrequest.h.

References requests_.

const Cont& OSB_LIB::StatusRequests::requests (  )  const

Read access to list of status requests.

void OSB_LIB::StatusRequests::setPeriod ( const Period period  ) 

Set the time period.

Parameters:
period New time period to use.
Clears the list of status requests.

size_t OSB_LIB::StatusRequests::size (  )  const [inline]

Number of status requests in the list.

Definition at line 502 of file statusrequest.h.

References requests_.

void OSB_LIB::StatusRequests::swap ( StatusRequests rhs  )  throw ()

Swap two status request lists.


Friends And Related Function Documentation

friend class OSB_DB::StatusRequestGw [friend]

Read and populate status requests from the database.

Definition at line 337 of file statusrequest.h.


Member Data Documentation

Period OSB_LIB::StatusRequests::period_ [private]

Time period covered by the status requests.

Definition at line 448 of file statusrequest.h.

Cont OSB_LIB::StatusRequests::requests_ [private]

List of status requests for the time period.

An empty list implies that the status requests have not been read from the database.

ToDo: Should be introduce a flag that tell us that there are no valid status requests at all for the entity?

Definition at line 458 of file statusrequest.h.

Referenced by begin(), empty(), end(), rbegin(), rend(), and size().


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:13:13 2006 for OSB Library by  doxygen 1.4.7