/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
DayaBay::RegistrationSequence Class Reference

Lists the order of registration of Data Objects. More...

#include <RegistrationSequence.h>

Inheritance diagram for DayaBay::RegistrationSequence:
Inheritance graph
[legend]
Collaboration diagram for DayaBay::RegistrationSequence:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
IRegistrationSequence::Registration 
Registration
typedef
IRegistrationSequence::Registrations 
Registrations
 A list of object registrations.
typedef
IRegistrationSequence::size_type 
size_type

Public Member Functions

virtual const std::string & defLoc () const
 RegistrationSequence ()
 Default Constructor.
virtual ~RegistrationSequence ()
 Destructor.
virtual const CLID & clID () const
virtual bool empty () const
 True if this object does not conatin any registrations.
virtual size_type size () const
 Returns the number of registrations this object contains.
virtual const Registrationsregistrations () const
 The list of objects registered with thi object.
virtual Registrations registration (const std::string &path) const
 Return all Registration with the given TES path.
virtual Registrationregistration (const DataObject *dobj) const
 Look up a Registration based on object pointer or NULL if fail.
void insert (IRegistry *registry, DataObject *object, bool marked)
 Inserts the specified data as a new registration.
void setRegistrations (Registrations *value)
 Set the Registration vector.
std::ostream & fillStream (std::ostream &s) const
 Serialize to an ostream.
virtual const std::string & defLoc ()
 Default location in the TES for this type of object.
virtual void setOutputAddress (const GenericAddress *roa)
 Set the output address when this header object is written out.
virtual void setInputAddress (const GenericAddress *ria)
 Set the input address when this header object is read in.
virtual const TimeStampearliest () const
 Retrieve const The earliest time of the existence of the object.
void setEarliest (const TimeStamp &value)
 Update The earliest time of the existence of the object.
virtual const TimeStamplatest () const
 Retrieve const The latest time of the existence of the object.
void setLatest (const TimeStamp &value)
 Update The latest time of the existence of the object.
virtual const GenericAddress * outputAddress () const
 Retrieve const Output address containing output stream, entry and path (base class of RootIOAddress)
virtual const GenericAddress * inputAddress () const
 Retrieve const Input address containing input stream, entry and path (base class of RootIOAddress)

Static Public Member Functions

static const std::string & defaultLocation ()
 Give access to default location from class scope.
static const CLID & classID ()
static void * operator new (size_t size)
 operator new
static void * operator new (size_t size, void *pObj)
 placement operator new it is needed by libstdc++ 3.2.3 (e.g.
static void operator delete (void *p)
 operator delete
static void operator delete (void *p, void *pObj)
 placement operator delete not sure if really needed, but it does not harm

Private Attributes

Registrationsm_registrations
 The list of objects registered with thi object.

Detailed Description

Lists the order of registration of Data Objects.

Author:
Simon Patton <SJPatton@lbl.gov> created Thu Dec 5 17:38:15 2013

Definition at line 50 of file RegistrationSequence.h.


Member Typedef Documentation

Reimplemented from IRegistrationSequence.

Definition at line 59 of file RegistrationSequence.h.

A list of object registrations.

Reimplemented from IRegistrationSequence.

Definition at line 61 of file RegistrationSequence.h.

Reimplemented from IRegistrationSequence.

Definition at line 63 of file RegistrationSequence.h.


Constructor & Destructor Documentation

DayaBay::RegistrationSequence::RegistrationSequence ( )

Default Constructor.

Definition at line 5 of file RegistrationSequence.cc.

DayaBay::RegistrationSequence::~RegistrationSequence ( ) [virtual]

Destructor.

Definition at line 12 of file RegistrationSequence.cc.

{
    if (m_registrations) {
        m_registrations->clear();
        delete m_registrations;
        m_registrations = 0;
    }
}

Member Function Documentation

static const std::string& DayaBay::RegistrationSequence::defaultLocation ( ) [inline, static]

Give access to default location from class scope.

Definition at line 55 of file RegistrationSequence.h.

virtual const std::string& DayaBay::RegistrationSequence::defLoc ( ) const [inline, virtual]

Definition at line 56 of file RegistrationSequence.h.

const CLID & DayaBay::RegistrationSequence::clID ( ) const [inline, virtual]

Reimplemented from DayaBay::TemporalDataObject.

Definition at line 155 of file RegistrationSequence.h.

const CLID & DayaBay::RegistrationSequence::classID ( ) [inline, static]

Reimplemented from DayaBay::TemporalDataObject.

Definition at line 160 of file RegistrationSequence.h.

{
  return CLID_RegistrationSequence;
}
bool RegistrationSequence::empty ( ) const [virtual]

True if this object does not conatin any registrations.

Implements IRegistrationSequence.

Definition at line 29 of file RegistrationSequence.cc.

{
  return m_registrations->empty();
}
RegistrationSequence::size_type RegistrationSequence::size ( ) const [virtual]

Returns the number of registrations this object contains.

Implements IRegistrationSequence.

Definition at line 34 of file RegistrationSequence.cc.

{
  return m_registrations->size();
}
const RegistrationSequence::Registrations & RegistrationSequence::registrations ( ) const [virtual]

The list of objects registered with thi object.

Implements IRegistrationSequence.

Definition at line 39 of file RegistrationSequence.cc.

                                                                                   {
  return *m_registrations;
}
RegistrationSequence::Registrations RegistrationSequence::registration ( const std::string &  path) const [virtual]

Return all Registration with the given TES path.

Implements IRegistrationSequence.

Definition at line 73 of file RegistrationSequence.cc.

{
    Registrations ret;

    IRegistrationSequence::Registrations::iterator it, 
        done = m_registrations->end();
    for (it = m_registrations->begin(); it != done; ++it) {
        if (it->path() == path) ret.push_back(*it);
    }
    return ret;
}
RegistrationSequence::Registration * RegistrationSequence::registration ( const DataObject *  dobj) const [virtual]

Look up a Registration based on object pointer or NULL if fail.

Implements IRegistrationSequence.

Definition at line 86 of file RegistrationSequence.cc.

{
    IRegistrationSequence::Registrations::iterator it, 
        done = m_registrations->end();
    for (it = m_registrations->begin(); it != done; ++it) {
        if (it->object() == dobj) return &(*it);
    }
    return 0;    
}
void RegistrationSequence::insert ( IRegistry *  registry,
DataObject *  object,
bool  marked 
)

Inserts the specified data as a new registration.

Definition at line 43 of file RegistrationSequence.cc.

                                               {
  if ( 0 == object) {
    return;
  }

  TemporalDataObject* temporal = dynamic_cast<TemporalDataObject*>(object);
  if (0 != temporal) {
      // only do something when the object has a meaningful time
      if(temporal->earliest() != TimeStamp::GetBOT() &&
         temporal->latest()   != TimeStamp::GetBOT() ) {

          if (TimeStamp::GetBOT() == earliest() || earliest() > temporal->earliest()) {
              setEarliest(temporal->earliest());
          }
      
          if (TimeStamp::GetBOT() == latest() || latest() < temporal->latest()) {
              setLatest(temporal->latest());
          }
      }
  }

  m_registrations->push_back(Registration(registry,
                                          object,
                                          marked));

}
void DayaBay::RegistrationSequence::setRegistrations ( Registrations value)

Set the Registration vector.

Definition at line 23 of file RegistrationSequence.cc.

{
    delete m_registrations;
    m_registrations = value;
}
std::ostream & RegistrationSequence::fillStream ( std::ostream &  s) const [virtual]

Serialize to an ostream.

Reimplemented from IRegistrationSequence.

Definition at line 96 of file RegistrationSequence.cc.

{
    TemporalDataObject::fillStream(s);
    s << "{ " << m_registrations->size() << " registrations :\n";
    IRegistrationSequence::Registrations::iterator it, 
        done = m_registrations->end();
    int count = 0;
    for (it = m_registrations->begin(); it != done; ++it) {
        DataObject* dobj = it->object();

        s << "\n[" << count++ << "] " << dobj->name() 
          << " (entry=" << it->entry() 
          << ",store=" << it->store() << ")"
          << ": "; dobj->fillStream(s);
    }
    s << "\n}\n";
    return s;
}
static void* DayaBay::RegistrationSequence::operator new ( size_t  size) [inline, static]

operator new

Reimplemented from DayaBay::TemporalDataObject.

Definition at line 104 of file RegistrationSequence.h.

    {
      return ( sizeof(RegistrationSequence) == size ? 
               boost::singleton_pool<RegistrationSequence, sizeof(RegistrationSequence)>::malloc() :
               ::operator new(size) );
    }
static void* DayaBay::RegistrationSequence::operator new ( size_t  size,
void *  pObj 
) [inline, static]

placement operator new it is needed by libstdc++ 3.2.3 (e.g.

in std::vector) it is not needed in libstdc++ >= 3.4

Reimplemented from DayaBay::TemporalDataObject.

Definition at line 114 of file RegistrationSequence.h.

static void DayaBay::RegistrationSequence::operator delete ( void *  p) [inline, static]

operator delete

Reimplemented from DayaBay::TemporalDataObject.

Definition at line 120 of file RegistrationSequence.h.

    {
      boost::singleton_pool<RegistrationSequence, sizeof(RegistrationSequence)>::is_from(p) ?
      boost::singleton_pool<RegistrationSequence, sizeof(RegistrationSequence)>::free(p) :
      ::operator delete(p);
    }
static void DayaBay::RegistrationSequence::operator delete ( void *  p,
void *  pObj 
) [inline, static]

placement operator delete not sure if really needed, but it does not harm

Reimplemented from DayaBay::TemporalDataObject.

Definition at line 129 of file RegistrationSequence.h.

    {
      ::operator delete (p, pObj);
    }
const std::string & DayaBay::TemporalDataObject::defLoc ( ) [virtual, inherited]

Default location in the TES for this type of object.

Definition at line 17 of file TemporalDataObject.cc.

{
    cerr << "TemporalDataObject::defLoc() called.  Some method did not define a default location!" << endl;
    static string empty("");
    return empty;
}
void DayaBay::TemporalDataObject::setOutputAddress ( const GenericAddress *  roa) [virtual, inherited]

Set the output address when this header object is written out.

Definition at line 26 of file TemporalDataObject.cc.

{
  // bad input
  if(roa==0) {
    return;
  }
    
  // prepare to set
  if(m_outputAddress!=0) {
    m_outputAddress->release();
  }

  GenericAddress* non_const_roa=const_cast<GenericAddress*>(roa);

  m_outputAddress=non_const_roa;
  m_outputAddress->addRef();
}
void DayaBay::TemporalDataObject::setInputAddress ( const GenericAddress *  ria) [virtual, inherited]

Set the input address when this header object is read in.

Definition at line 46 of file TemporalDataObject.cc.

{
  // bad input
  if(ria==0) {
    return;
  }

  // prepare to set
  if(m_inputAddress!=0) {
    m_inputAddress->release();
  }

  GenericAddress* non_const_ria=const_cast<GenericAddress*>(ria);

  m_inputAddress=non_const_ria;
  m_inputAddress->addRef();
}
const TimeStamp & DayaBay::TemporalDataObject::earliest ( ) const [inline, virtual, inherited]

Retrieve const The earliest time of the existence of the object.

Implements DayaBay::ITemporal.

Definition at line 177 of file TemporalDataObject.h.

{
  return m_earliest;
}
void DayaBay::TemporalDataObject::setEarliest ( const TimeStamp value) [inline, virtual, inherited]

Update The earliest time of the existence of the object.

Implements DayaBay::ITemporal.

Definition at line 182 of file TemporalDataObject.h.

{
  m_earliest = value;
}
const TimeStamp & DayaBay::TemporalDataObject::latest ( ) const [inline, virtual, inherited]

Retrieve const The latest time of the existence of the object.

Implements DayaBay::ITemporal.

Definition at line 187 of file TemporalDataObject.h.

{
  return m_latest;
}
void DayaBay::TemporalDataObject::setLatest ( const TimeStamp value) [inline, virtual, inherited]

Update The latest time of the existence of the object.

Implements DayaBay::ITemporal.

Definition at line 192 of file TemporalDataObject.h.

{
  m_latest = value;
}
const GenericAddress * DayaBay::TemporalDataObject::outputAddress ( ) const [inline, virtual, inherited]

Retrieve const Output address containing output stream, entry and path (base class of RootIOAddress)

Definition at line 197 of file TemporalDataObject.h.

{
  return m_outputAddress;
}
const GenericAddress * DayaBay::TemporalDataObject::inputAddress ( ) const [inline, virtual, inherited]

Retrieve const Input address containing input stream, entry and path (base class of RootIOAddress)

Definition at line 202 of file TemporalDataObject.h.

{
  return m_inputAddress;
}

Member Data Documentation

The list of objects registered with thi object.

Definition at line 138 of file RegistrationSequence.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:58:11 for BaseEvent by doxygen 1.7.4