8 #include <boost/algorithm/string.hpp>
9 #include <boost/lexical_cast.hpp>
14 #include <GaudiKernel/DataObjectDescriptor.h>
27 std::stringstream str;
39 str << boost::lexical_cast<std::string>(
m_optional) << FIELD_SEP;
46 return "DataObjectDescriptor(\"" +
toString() +
"\")";
54 std::vector<std::string> items;
56 boost::split(items, s, boost::is_any_of(boost::lexical_cast<std::string>(
FIELD_SEP)), boost::token_compress_on);
63 std::vector<std::string> addr;
64 boost::split(addr, items[1], boost::is_any_of(boost::lexical_cast<std::string>(
ADDR_SEP)), boost::token_compress_on);
101 std::vector<std::string> items;
103 boost::split(items, s,
104 boost::is_any_of(boost::lexical_cast<std::string>(
FIELD_SEP)),
105 boost::token_compress_on);
125 if(!addresses.empty()){
134 m_altAddresses.assign(addresses.begin() + skipFirst, addresses.end());
138 std::stringstream out;
141 out << it->second->descriptor()->toString() <<
ITEM_SEP;
144 std::string sOut = out.str();
146 return sOut.substr(0, sOut.length()-1);
161 return "DataObjectDescriptorCollection(\"" +
toString() +
"\")";
171 std::vector<std::string> locations;
173 locations.emplace_back(productName);
175 std::sort(locations.begin(), locations.end());
181 if(
item.second->dataProductName() == productName)
185 std::vector<std::string> iLocations;
186 iLocations.emplace_back(
item.second->dataProductName());
187 iLocations.insert(iLocations.end(),
item.second->alternativeDataProductNames().begin(),
item.second->alternativeDataProductNames().end());
188 std::sort(iLocations.begin(), iLocations.end());
190 auto it=std::set_intersection (iLocations.begin(), iLocations.end(), locations.begin(), locations.end(), iLocations.begin());
193 if(std::distance(iLocations.begin(), it) > 0)
205 auto res =
m_dataItems.insert(std::make_pair(tag, descriptor));
239 m_dataItems.at(tag)->descriptor()->fromString(item);
297 return destination.
assign(*
this);
367 return destination.
assign(*
this);
388 std::vector<std::string> items;
389 boost::split(items, s, boost::is_any_of(boost::lexical_cast<std::string>(
ITEM_SEP)), boost::token_compress_on);
391 for(uint
i = 0;
i < items.size(); ++
i){
const std::vector< std::string > & alternativeDataProductNames() const
DataObjectDescriptorCollection * m_dataItems
DataObjectDescriptor * descriptor()
virtual void useReadHandler() const
use the call-back function at reading
MinimalDataObjectHandle::AccessType accessType() const
virtual bool assign(const Property &source)=0
import the property value form the source
std::ostream & operator<<(std::ostream &stream, const DataObjectDescriptor &di)
virtual DataObjectDescriptorProperty * clone() const
clone: "virtual constructor"
virtual std::string toString() const =0
value -> string
virtual bool assign(const Property &source)
import the property value form the source
void setTag(const std::string &tag)
const std::string & name() const
property name
DataObjectDescriptorCollection & operator=(const DataObjectDescriptorCollection &other)
virtual void toStream(std::ostream &out) const
value -> stream
virtual const DataObjectDescriptor & value() const
virtual std::string toString() const
value -> string
const DataObjectDescriptorCollection & value() const
void setAltAddresses(const std::vector< std::string > &addresses)
const std::string & tag() const
const std::string & dataProductName() const
Return the product name.
bool contains(const std::string &o) const
bool update(MinimalDataObjectHandle *item)
const std::string pythonRepr() const
virtual DataObjectDescriptorCollectionProperty * clone() const
clone: "virtual constructor"
virtual bool load(Property &destination) const
export the property value to the destination
virtual std::string toString() const
value -> string
bool setValue(DataObjectDescriptorCollection &value)
std::vector< std::string > m_altAddresses
void setAddress(const std::string &address)
virtual bool useUpdateHandler()
use the call-back function at update
This class is used for returning status codes from appropriate routines.
DataObjectDescriptorProperty & operator=(DataObjectDescriptorProperty &value)
const std::string toString() const
const std::string & address() const
MinimalDataObjectHandle::AccessType m_accessType
virtual bool assign(const Property &source)
import the property value form the source
virtual StatusCode fromString(const std::string &s)
string -> value
void setAddresses(const std::vector< std::string > &address)
void setOptional(bool optional)
bool insert(const std::string &tag, MinimalDataObjectHandle *descriptor)
Property base class allowing Property* collections to be "homogeneous".
void setName(std::string value)
set the new value for the property name
void fromString(const std::string &s)
virtual bool setValue(DataObjectDescriptor &value)
DataObjectDescriptorCollection()
void setAccessType(MinimalDataObjectHandle::AccessType accessType)
static const std::string NULL_
AccessType
The type of the access.
virtual bool load(Property &destination) const
export the property value to the destination
DataObjectDescriptor * m_item
const MinimalDataObjectHandle & operator[](const std::string &tag) const
DataObjectDescriptorProperty(const std::string &name, DataObjectDescriptor &item)
const std::string toString() const
const std::vector< std::string > & alternativeAddresses() const
virtual void toStream(std::ostream &out) const
value -> stream
const std::string pythonRepr() const
DataObjectDescriptorCollectionProperty & operator=(DataObjectDescriptorCollectionProperty &value)
DataObjectDescriptorCollectionProperty(const std::string &name, DataObjectDescriptorCollection &items)
virtual StatusCode fromString(const std::string &s)
string -> value