84 static TYP
min() {
return std::numeric_limits<TYP>::min(); }
86 static TYP
max() {
return std::numeric_limits<TYP>::max(); }
93 Range(
const bool ,
const bool ) {}
99 bool lower()
const {
return false; }
105 static bool min() {
return false; }
107 static bool max() {
return true; }
142 static _Item*
create(
INTuple* tup,
const std::string&
name,
const std::type_info& info, TYP min, TYP max,
163 long len, TYP min, TYP max, TYP def );
167 long len = this->
length();
168 if ( len == copy.
length() ) {
169 const T* source = (
const T*)copy.
buffer();
170 std::copy_n( source, len, this->
m_buffer );
173 throw std::out_of_range(
"N-tuple matrix cannot be copied! The index range does not match!" );
196 long ncol,
long nrow, TYP min, TYP max, TYP def );
200 long len = this->
length();
201 if ( len == copy.
length() ) {
202 const T* source = (
const T*)copy.
buffer();
203 std::copy_n( source, len, this->
m_buffer );
206 throw std::out_of_range(
"N-tuple matrix cannot be copied! The index range does not match!" );
239 operator const void*()
const {
return m_ptr; }
258 operator const TYP()
const {
return this->
m_ptr->get(); }
270 this->
m_ptr->set( data );
276 this->
m_ptr->set( data->get() );
280 this->
m_ptr->set( this->
m_ptr->get() + data );
284 this->
m_ptr->set( this->
m_ptr->get() - data );
288 this->
m_ptr->set( this->
m_ptr->get() * data );
292 this->
m_ptr->set( this->
m_ptr->get() / data );
307 operator bool()
const {
return this->
m_ptr->get(); }
310 this->
m_ptr->set( data );
316 this->
m_ptr->set( data->get() );
331 *( this->
m_ptr ) = *( copy.operator->() );
337 return this->
m_ptr->data( i );
342 return this->
m_ptr->data( i );
359 *( this->
m_ptr ) = *( copy.operator->() );
365 return this->
m_ptr->column( i );
370 return this->
m_ptr->column( i );
384 template <
class TYPE>
388 }
catch ( ... ) { result =
nullptr; }
392 template <
class TYPE>
397 }
catch ( ... ) { result =
nullptr; }
404 }
catch ( ... ) { result =
nullptr; }
408 template <
class TYPE>
412 }
catch ( ... ) { result =
nullptr; }
416 template <
class TYPE>
420 }
catch ( ... ) { result =
nullptr; }
424 template <
class TYPE>
435 template <
class TYPE>
444 template <
class TYPE>
453 template <
class TYPE>
463 template <
class TYPE>
468 template <
class TYPE>
473 template <
class TYPE>
478 template <
class TYPE>
483 template <
class TYPE>
489 template <
class TYPE>
507 template <
class TYPE>
521 template <
class TYPE>
556 template <
class TYPE,
class RANGE>
574 template <
class TYPE>
598 template <
class TYPE,
class RANGE>
600 return i_addItem(
name, dim,
"", TYPE( low ), TYPE( high ), array.m_ptr );
633 template <
class TYPE,
class INDEX,
class RANGE>
636 return i_addItem(
name, index->range().distance(), index->name(), TYPE( low ), TYPE( high ), array.m_ptr );
664 template <
class TYPE,
class INDEX,
class RANGE>
667 return i_addItem(
name, index->range().distance(), index->name(), TYPE( low ), TYPE( high ), array.m_ptr );
694 template <
class TYPE,
class INDEX>
719 template <
class TYPE,
class INDEX>
742 template <
class TYPE>
769 template <
class TYPE,
class RANGE>
800 template <
class TYPE,
class INDEX>
826 template <
class TYPE,
class INDEX>
864 template <
class TYPE,
class INDEX,
class RANGE>
867 return i_addItem(
name, index->range().distance(), rows, index->name(), TYPE( low ), TYPE( high ), matrix.
m_ptr );
897 template <
class TYPE,
class INDEX,
class RANGE>
899 const RANGE low,
const RANGE high ) {
900 return i_addItem(
name, index->range().distance(), rows, index->name(), TYPE( low ), TYPE( high ), matrix.
m_ptr );
973#ifndef ALLOW_ALL_TYPES
1014 return s << T( obj );
unsigned int CLID
Class ID definition.
SmartDataPtr< NTuple::Directory > NTupleDirPtr
SmartDataPtr< NTuple::Tuple > NTuplePtr
SmartDataPtr< NTuple::File > NTupleFilePtr
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
virtual const CLID & clID() const
Retrieve reference to class definition structure.
DataObject()
Standard Constructor.
NTuple interface class definition.
virtual INTupleItem * i_find(const std::string &name) const =0
Internally used by abstract classes.
virtual StatusCode add(INTupleItem *item)=0
Add an item row to the N tuple.
NTuple interface class definition.
virtual const void * buffer() const =0
Access data buffer (CONST)
virtual const std::string & index() const =0
Access the index _Item.
virtual long length() const =0
Access the buffer length.
virtual const std::string & name() const =0
Access _Item name.
Opaque address interface definition.
Class acting as a smart pointer holding a N tuple entry.
TYP * m_ptr
Pointer to instance.
virtual ~_Accessor()=default
Standard Destructor.
_Accessor()=default
Standard Constructor.
_Accessor(const _Accessor &)=default
Default copy constructor.
TYP * operator->()
Dereference operator.
bool operator!() const
Check if column is present.
const Range< TYP > & range() const
Access the range.
const TYP * operator->() const
Dereference operator (CONST)
_Accessor< TYP > & operator=(const _Accessor< TYP > &)=delete
Needs to be implemented in derived classes.
Abstract class describing a column-array in a N tuple.
_Array< TYP > & operator=(const _Array< T > ©)
Assignment operator.
const TYP & data(long i) const
Access to data by reference (CONST)
TYP & data(long i)
Access to data by reference (CONST)
static _Array * create(INTuple *tup, const std::string &name, const std::type_info &info, const std::string &index, long len, TYP min, TYP max, TYP def)
Create instance.
Abstract class describing basic data in an Ntuple.
virtual void setDefault(const TYP d)=0
Set default value.
virtual const ItemRange & range() const =0
Access the range if specified.
TYP * m_buffer
Pointer to data buffer.
Range< TYP > ItemRange
Set type definition to make life more easy easy.
Abstract class describing a column in a N tuple.
_Item< TYP > & operator=(const _Item< T > ©)
Assignment operator.
void set(const TYP &item)
Access to data by reference.
virtual TYP get() const
Access to data by reference (CONST)
static _Item * create(INTuple *tup, const std::string &name, const std::type_info &info, TYP min, TYP max, TYP def)
Create instance.
Abstract class describing a matrix column in a N tuple.
static _Matrix * create(INTuple *tup, const std::string &name, const std::type_info &info, const std::string &index, long ncol, long nrow, TYP min, TYP max, TYP def)
Create instance.
_Matrix< TYP > & operator=(const _Matrix< T > ©)
Assignment operator.
TYP * column(long i)
Access to data by reference.
const TYP * column(long i) const
Access to data by reference (CONST)
long m_rows
Number of rows per column.
Class acting as a smart pointer holding a N tuple _Item.
TYP & operator[](const T i)
Array operator.
Array & operator=(const Array< T > ©)
Assignment operator.
const TYP & operator[](const T i) const
Array operator.
Array()=default
Standard Constructor.
void setLogicalName(std::string l)
std::string m_name
Physical file name.
static const CLID & classID()
class ID of the object
bool m_isOpen
Flag to indicate wether the file was opened already.
File(long type, std::string name, std::string logName)
Standard constructor.
std::string m_logName
Logical file name.
void setOpen(bool flag)
Set "open" flag.
long type() const
Return access type.
void setName(std::string nam)
Set access type.
void setType(const long typ)
Set access type.
bool isOpen() const
Access "open" flag.
const std::string & name() const
Retrun physical file name.
const CLID & clID() const override
class ID of the object
const std::string & logicalName() const
Class acting as a smart pointer holding a N tuple _Item.
Item< TYP > & operator*=(const TYP data)
Item()=default
Standard Constructor.
TYP operator*()
Dereference operator for pointers.
Item & operator=(const Item< T > &data)
Assignment operator.
Item()=default
Standard Constructor.
Item< TYP > & operator+=(const TYP data)
const TYP operator*() const
Dereference operator for pointers(CONST)
Item & operator=(const TYP data)
Assignment operator.
Item & operator=(const Item< T > &data)
Assignment operator.
Item< TYP > & operator/=(const TYP data)
Item & operator=(const bool data)
Assignment operator.
Item< TYP > & operator-=(const TYP data)
Class acting as a smart pointer holding a N tuple _Item.
const TYP * operator[](const T i) const
Array operator.
virtual ~Matrix()=default
TYP * operator[](const T i)
Array operator.
Matrix()=default
Standard Constructor.
Matrix & operator=(const Matrix< T > ©)
Assignment operator.
static TYP min()
Minimal number of data.
TYP lower() const
Lower boundary of range.
TYP upper() const
Upper boundary of range.
bool upper() const
Upper boundary of range.
TYP distance() const
Distance between lower and upper range.
virtual ~Range()=default
Destructor.
bool lower() const
Lower boundary of range.
TYP m_lower
Lower boundary of range.
Range(const Range< TYP > ©)
Copy constructor.
static TYP max()
Maximal number of data.
Range(const Range< bool > &)
Copy constructor.
TYP m_upper
Upper boundary of range.
bool distance() const
Distance between lower and upper range.
Range & operator=(const Range< TYP > ©)
Adjust ranges.
static bool max()
Maximal number of data.
static bool min()
Minimal number of data.
Range(const bool, const bool)
Standard constructor.
Range(TYP low, TYP upper)
Standard constructor.
virtual ~Range()=default
Destructor.
Abstract base class which allows the user to interact with the actual N tuple implementation.
StatusCode addIndexedItem(const std::string &name, Item< INDEX > &index, Array< TYPE > &array, const RANGE low, const RANGE high)
Add an indexed Array of data to a column wise N tuple with a range.
StatusCode i_addObject(const std::string &name, _Item< TYPE * > *&result, const std::type_info &)
StatusCode addIndexedItem(const std::string &name, Item< INDEX > &col_index, long rows, Matrix< TYPE > &matrix)
Add an variable size Matrix of data to a column wise N tuple.
StatusCode addItem(const std::string &name, Item< IOpaqueAddress * > &itm)
Add an address object item to an N tuple: specialized call.
StatusCode i_addItem(const std::string &name, long dim1, long dim2, const std::string &index, TYPE low, TYPE high, _Matrix< TYPE > *&result)
Add a _Item of data to the N tuple.
StatusCode item(const std::string &name, Item< TYPE > &result)
Locate a scalar Item of data to the N tuple type safe.
StatusCode addItem(const std::string &name, long dim, Array< TYPE > &array, const RANGE low, const RANGE high)
Add an fixed-size Array of data to a column wise N tuple with a range.
StatusCode i_item(const std::string &name, _Item< IOpaqueAddress * > *&result) const
Locate a _Column of data to the N tuple type safe.
StatusCode addIndexedItem(const std::string &name, Item< INDEX > &index, Array< TYPE > &array)
Add an indexed Array of data to a column wise N tuple.
StatusCode addItem(const std::string &name, Item< TYPE > &itm, const RANGE low, const RANGE high)
Add a scalar data item a N tuple with a range.
StatusCode item(const std::string &name, const Item< TYPE > &result) const
Locate a scalar Item of data to the N tuple type safe (CONST)
StatusCode i_addItem(const std::string &name, long dim, const std::string &index, TYPE low, TYPE high, _Array< TYPE > *&result)
Add a _Item of data to the N tuple.
StatusCode addItem(const std::string &name, long dim, Array< TYPE > &array)
Add an fixed-size Array of data to a column wise N tuple.
StatusCode i_item(const std::string &name, _Array< TYPE > *&result) const
Locate a _Array of data to the N tuple type safe.
StatusCode addItem(const std::string &name, Item< INDEX > &index, Matrix< TYPE > &matrix, long rows, const RANGE low, const RANGE high)
Add an variable size Matrix of data to a column wise N tuple.
StatusCode i_item(const std::string &name, _Item< TYPE * > *&result) const
Locate a _Column of data to the N tuple type unsafe for objects.
StatusCode addItem(const std::string &name, Item< INDEX > &index, Array< TYPE > &array, const RANGE low, const RANGE high)
Add an indexed Array of data to a column wise N tuple with a range.
StatusCode item(const std::string &name, const Matrix< TYPE > &result) const
Locate a Matrix of data to the N tuple type safe (CONST)
StatusCode i_item(const std::string &name, _Item< TYPE > *&result) const
Locate a _Column of data to the N tuple type safe.
StatusCode addIndexedItem(const std::string &name, Item< INDEX > &index, long rows, Matrix< TYPE > &matrix, const RANGE low, const RANGE high)
Add an variable size Matrix of data to a column wise N tuple.
StatusCode addItem(const std::string &name, Item< INDEX > &index, Array< TYPE > &array)
Add an indexed Array of data to a column wise N tuple.
StatusCode i_item(const std::string &name, _Matrix< TYPE > *&result) const
Locate a _Matrix of data to the N tuple type safe.
StatusCode item(const std::string &name, const Array< TYPE > &result) const
Locate a Array of data to the N tuple type safe (CONST)
StatusCode addItem(const std::string &name, Item< TYPE * > &itm)
Add an simple object item to an N tuple.
StatusCode addItem(const std::string &name, Item< INDEX > &index, Matrix< TYPE > &matrix, long rows)
Add an variable size Matrix of data to a column wise N tuple.
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
StatusCode addItem(const std::string &name, long cols, long rows, Matrix< TYPE > &result, const RANGE low, const RANGE high)
Add an fixed size Matrix of data to a column wise N tuple.
StatusCode item(const std::string &name, Array< TYPE > &result)
Locate a Array of data to the N tuple type safe.
StatusCode i_addItem(const std::string &name, long, const std::string &, TYPE low, TYPE high, _Item< TYPE > *&result)
Add a _Item of data to the N tuple.
StatusCode item(const std::string &name, Matrix< TYPE > &result)
Locate a Matrix of data to the N tuple type safe.
StatusCode addItem(const std::string &name, long cols, long rows, Matrix< TYPE > &matrix)
Add an fixed size Matrix of data to a column wise N tuple.
A small class used to access easily (and efficiently) data items residing in data stores.
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE
std::ostream & operator<<(std::ostream &s, const Item< T > &obj)
Small class representing an N tuple directory in the transient store.
static const CLID & classID()
class ID of the object
const CLID & clID() const override
class ID of the object