92 std::istringstream(upi) >> *
this;
103 return static_cast<const JUPI_t&
>(*this);
147 std::ostringstream os;
218 in >>
static_cast<JPBS_t&
>(object);
228 if (in.peek() == (
int)
DOT) {
237 }
else if (in >>
object.
version &&
238 in.get() == (
int)
DOT &&
239 in >>
object.number) {
245 in.setstate(ios::failbit);
268 os <<
object.getVersion();
274 os <<
object.getNumber();
277 return out << os.str();
290 static int compare(
const std::string& first,
const std::string& second)
294 const size_t pos = min(first.size(), second.size());
296 if (first.substr(0,pos) < second.substr(0,pos))
298 else if (first.substr(0,pos) > second.substr(0,pos))
Auxiliary classes and methods for database I/O.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Product breakdown structure (PBS).
static const char DOT
Separator between PBS values.
const JPBS_t & getPBS() const
Get PBS.
Universal product identifier (UPI).
JUPI_t(const std::string &upi)
Constructor.
static const int DEFAULT_VERSION
Default version.
std::string toString() const
Convert UPI.
int getVersion() const
Get version.
friend bool operator==(const JUPI_t &first, const JUPI_t &second)
Equality.
static const int DEFAULT_NUMBER
Default number.
friend std::ostream & operator<<(std::ostream &out, const JUPI_t &object)
Write UPI to output stream.
JUPI_t(const JPBS_t &pbs, const std::string &variant, const int version, const int number)
Constructor.
static int compare(const std::string &first, const std::string &second)
Compare sub-strings.
JUPI_t(const JPBS_t &pbs)
Constructor.
friend bool operator<(const JUPI_t &first, const JUPI_t &second)
Less-than operator.
friend std::istream & operator>>(std::istream &in, JUPI_t &object)
Read UPI from input stream.
static const char SEPARATOR
Separator between PBS, variant and version.
const JUPI_t & getUPI() const
Get UPI.
const std::string & getVariant() const
Get variant.
JUPI_t()
Default constructor.
int getNumber() const
Get serial number.