PSEnv::EnvObjectStore Class Reference
[PSEnv package]

Class to store environment data objects (such as configuration or calibration) corresponding to event data objects. More...

#include <EnvObjectStore.h>

List of all members.

Public Member Functions

 EnvObjectStore (const boost::shared_ptr< PSEvt::ProxyDictI > &dict)
 Standard constructor takes proxy dictionary object.
 ~EnvObjectStore ()
template<typename T>
void putProxy (const boost::shared_ptr< PSEvt::Proxy< T > > &proxy, const Pds::Src &source, const std::string &key=std::string())
 Add one more proxy object to the store.
template<typename T>
void put (const boost::shared_ptr< T > &data, const Pds::Src &source, const std::string &key=std::string())
 Add one more object to the store.
GetResultProxy get (const Pds::Src &source, const std::string &key=std::string())
 Get an object from store.
GetResultProxy get (const PSEvt::Source &source, Pds::Src *foundSrc=NULL, const std::string &key=std::string())
 Get an object from store.
std::list< PSEvt::EventKeykeys (const PSEvt::Source &source=PSEvt::Source()) const
 Get the list of keys for existing config objects.
const boost::shared_ptr< PSEvt::ProxyDictI > & proxyDict () const
 Get access to proxy dictionary.

Classes

struct  GetResultProxy
 Special class used for type-less return from get(). More...


Detailed Description

Class to store environment data objects (such as configuration or calibration) corresponding to event data objects.

This class is very similar to PSEvt::Event class (and is implemented on top of the same proxy dictionary classes) but it has more specialized interface. In particular it does not support additional string keys as it is expected that there will be only one version of the configuration or calibrations objects.

This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.

See also:
Env
Version:
$Id: EnvObjectStore.h -1$
Author:
Andrei Salnikov

Definition at line 66 of file EnvObjectStore.h.


Constructor & Destructor Documentation

PSEnv::EnvObjectStore::EnvObjectStore ( const boost::shared_ptr< PSEvt::ProxyDictI > &  dict  )  [inline, explicit]

Standard constructor takes proxy dictionary object.

Parameters:
[in] dict Pointer to proxy dictionary

Definition at line 90 of file EnvObjectStore.h.

PSEnv::EnvObjectStore::~EnvObjectStore (  )  [inline]

Definition at line 93 of file EnvObjectStore.h.


Member Function Documentation

GetResultProxy PSEnv::EnvObjectStore::get ( const PSEvt::Source source,
Pds::Src *  foundSrc = NULL,
const std::string &  key = std::string() 
) [inline]

Get an object from store.

Parameters:
[in] source - Source detector address.
[out] foundSrc - If pointer is non-zero then pointed object will be assigned with the exact source address of the returned object.
[in] key - ...
Returns:
Shared pointer (or object convertible to it) which can be zero when object is not found.

Definition at line 158 of file EnvObjectStore.h.

GetResultProxy PSEnv::EnvObjectStore::get ( const Pds::Src &  source,
const std::string &  key = std::string() 
) [inline]

Get an object from store.

Parameters:
[in] source - Source detector address.
[in] key - ...
Returns:
Shared pointer (or object convertible to it) which can be zero when object is not found.

Definition at line 143 of file EnvObjectStore.h.

std::list<PSEvt::EventKey> PSEnv::EnvObjectStore::keys ( const PSEvt::Source source = PSEvt::Source()  )  const [inline]

Get the list of keys for existing config objects.

Returns:
list of the EventKey objects

Definition at line 169 of file EnvObjectStore.h.

const boost::shared_ptr<PSEvt::ProxyDictI>& PSEnv::EnvObjectStore::proxyDict (  )  const [inline]

Get access to proxy dictionary.

This method exposes underlying proxy dictionary object. It should not be used by ordinary clients but it could be useful for code which implements additional services based on event (such as Python wrappers).

Definition at line 184 of file EnvObjectStore.h.

template<typename T>
void PSEnv::EnvObjectStore::put ( const boost::shared_ptr< T > &  data,
const Pds::Src &  source,
const std::string &  key = std::string() 
) [inline]

Add one more object to the store.

If there is already an object with the same type and address it will be replaced.

Parameters:
[in] data - Object to store in the event.
[in] source - Source detector address.
[in] key - ...

Definition at line 124 of file EnvObjectStore.h.

template<typename T>
void PSEnv::EnvObjectStore::putProxy ( const boost::shared_ptr< PSEvt::Proxy< T > > &  proxy,
const Pds::Src &  source,
const std::string &  key = std::string() 
) [inline]

Add one more proxy object to the store.

Parameters:
[in] proxy - Proxy object for type T.
[in] source - Source detector address.
[in] key - ...

Definition at line 103 of file EnvObjectStore.h.


The documentation for this class was generated from the following file:
Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7