#include <ProxyDictI.h>
Inheritance diagram for PSEvt::ProxyDictI:
Public Member Functions | |
virtual | ~ProxyDictI () |
void | put (const boost::shared_ptr< ProxyI > &proxy, const EventKey &key) |
Add one more proxy object to the dictionary. | |
boost::shared_ptr< void > | get (const std::type_info *typeinfo, const Source &source, const std::string &key, Pds::Src *foundSrc) |
Get an object from event. | |
bool | exists (const EventKey &key) |
Check if proxy of given type exists in the event. | |
bool | remove (const EventKey &key) |
Remove object of given type from the event. | |
void | keys (std::list< EventKey > &keys, const Source &source) const |
Get the list of event keys defined in event. | |
virtual const HistI * | hist () const |
return pointer to history interface object, if implemented | |
virtual const AliasMap * | aliasMap () const |
Return pointer to alias map. | |
Protected Member Functions | |
ProxyDictI () | |
virtual void | putImpl (const boost::shared_ptr< ProxyI > &proxy, const EventKey &key)=0 |
Add one more proxy object to the dictionary. | |
virtual boost::shared_ptr< void > | getImpl (const std::type_info *typeinfo, const Source &source, const std::string &key, Pds::Src *foundSrc)=0 |
Get an object from event. | |
virtual bool | existsImpl (const EventKey &key)=0 |
Check if proxy of given type exists in the event. | |
virtual bool | removeImpl (const EventKey &key)=0 |
Remove object of given type from the event. | |
virtual void | keysImpl (std::list< EventKey > &keys, const Source &source) const =0 |
Get the list of event keys defined in event. |
The client-side interface of this class is non-virtual and it forwards every class to virtual methods which define customization points to be implemented in subclasses.
Proxy dictionary stores proxy objects of type ProxyI which represent actual objects and know how to create or retrieve an object when requested. Proxy collection is indexed by the EventKey which identifies object data type, data source address, and additional string key.
This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.
Definition at line 70 of file ProxyDictI.h.
virtual PSEvt::ProxyDictI::~ProxyDictI | ( | ) | [inline, virtual] |
Definition at line 74 of file ProxyDictI.h.
PSEvt::ProxyDictI::ProxyDictI | ( | ) | [inline, protected] |
Definition at line 170 of file ProxyDictI.h.
virtual const AliasMap* PSEvt::ProxyDictI::aliasMap | ( | ) | const [inline, virtual] |
Return pointer to alias map.
Can return 0 pointer if alias map is not present.
Reimplemented in PSEvt::ProxyDict.
Definition at line 165 of file ProxyDictI.h.
bool PSEvt::ProxyDictI::exists | ( | const EventKey & | key | ) | [inline] |
Check if proxy of given type exists in the event.
This is optimized version of get() which only checks whether the proxy is there but does not ask proxy to do any real work.
[in] | key | Event key for the data object. |
Definition at line 122 of file ProxyDictI.h.
References existsImpl().
virtual bool PSEvt::ProxyDictI::existsImpl | ( | const EventKey & | key | ) | [protected, pure virtual] |
Check if proxy of given type exists in the event.
[in] | key | Event key for the data object. |
Implemented in PSEvt::ProxyDict.
Referenced by exists().
boost::shared_ptr<void> PSEvt::ProxyDictI::get | ( | const std::type_info * | typeinfo, | |
const Source & | source, | |||
const std::string & | key, | |||
Pds::Src * | foundSrc | |||
) | [inline] |
Get an object from event.
[in] | typeinfo | Dynamic type info object |
[in] | source | Source detector address. |
[in] | key | Optional key to distinguish different objects of the same type. |
[out] | foundSrc | If pointer is non-zero then pointed object will be assigned with the exact source address of the returned object. |
Definition at line 104 of file ProxyDictI.h.
References getImpl().
virtual boost::shared_ptr<void> PSEvt::ProxyDictI::getImpl | ( | const std::type_info * | typeinfo, | |
const Source & | source, | |||
const std::string & | key, | |||
Pds::Src * | foundSrc | |||
) | [protected, pure virtual] |
Get an object from event.
[in] | typeinfo | Dynamic type info object |
[in] | source | Source detector address. |
[in] | key | Optional key to distinguish different objects of the same type. |
[out] | foundSrc | If pointer is non-zero then pointed object will be assigned with the exact source address of the returned object. |
Implemented in PSEvt::ProxyDict.
Referenced by get().
virtual const HistI* PSEvt::ProxyDictI::hist | ( | ) | const [inline, virtual] |
return pointer to history interface object, if implemented
If a derived class implements the HistI interface, it can return a pointer to the history object here. The implementation of totalUpdates() should be all updates, put's and remove's, made to the ProxyDict during its existance. The implementation of updates(EventKey&) should be the sum of all puts and removes for the given EventKey.
Reimplemented in PSEvt::ProxyDictHist.
Definition at line 158 of file ProxyDictI.h.
Get the list of event keys defined in event.
[in] | source | matching source address |
[out] | keys | list of the EventKey objects |
Definition at line 144 of file ProxyDictI.h.
References keysImpl().
virtual void PSEvt::ProxyDictI::keysImpl | ( | std::list< EventKey > & | keys, | |
const Source & | source | |||
) | const [protected, pure virtual] |
Get the list of event keys defined in event.
[in] | source | matching source address |
[out] | keys | list of the EventKey objects |
Implemented in PSEvt::ProxyDict.
Referenced by keys().
void PSEvt::ProxyDictI::put | ( | const boost::shared_ptr< ProxyI > & | proxy, | |
const EventKey & | key | |||
) | [inline] |
Add one more proxy object to the dictionary.
By default the request is forwarded to the virtual method (customization point) but there is a possibility to do something else too if needed.
ExceptionDuplicateKey | ||
ExceptionNoAliasMap |
Definition at line 89 of file ProxyDictI.h.
References putImpl().
virtual void PSEvt::ProxyDictI::putImpl | ( | const boost::shared_ptr< ProxyI > & | proxy, | |
const EventKey & | key | |||
) | [protected, pure virtual] |
Add one more proxy object to the dictionary.
Implemented in PSEvt::ProxyDict, and PSEvt::ProxyDictHist.
Referenced by put().
bool PSEvt::ProxyDictI::remove | ( | const EventKey & | key | ) | [inline] |
Remove object of given type from the event.
[in] | key | Event key for the data object. |
Definition at line 133 of file ProxyDictI.h.
References removeImpl().
virtual bool PSEvt::ProxyDictI::removeImpl | ( | const EventKey & | key | ) | [protected, pure virtual] |
Remove object of given type from the event.
[in] | key | Event key for the data object. |
Implemented in PSEvt::ProxyDict, and PSEvt::ProxyDictHist.
Referenced by remove().