OpendTect  6.3
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IDWithGroup< GroupNrT, ObjNrT > Class Template Reference

A unique identifier for an object consisting of a group and an ID within the group. More...

Inheritance diagram for IDWithGroup< GroupNrT, ObjNrT >:
[legend]

Classes

class  GroupID
 
class  ObjID
 

Public Types

typedef GroupNrT GroupNrType
 
typedef ObjNrT ObjNrType
 

Public Member Functions

 IDWithGroup ()
 
 IDWithGroup (GroupID gid, ObjID oid)
 
virtual ~IDWithGroup ()
 
GroupID groupID () const
 
ObjID objID () const
 
GroupNrT groupNr () const
 
ObjNrT objNr () const
 
void setGroupID (GroupID id)
 
void setObjID (ObjID id)
 
void setGroupNr (GroupNrT nr)
 
void setObjNr (ObjNrT nr)
 
bool operator== (const IDWithGroup &oth) const
 
bool operator!= (const IDWithGroup &oth) const
 
virtual bool isInvalid () const
 
bool isValid () const
 
bool hasValidGroupID () const
 
bool hasValidObjID () const
 
void setInvalid ()
 
void setInvalidGroup ()
 
void setInvalidObj ()
 
virtual BufferString toString () const
 
virtual void fromString (const char *)
 
virtual int64_t toInt64 () const
 
virtual void fromInt64 (int64_t)
 

Static Public Member Functions

static IDWithGroup get (GroupNrT grpnr, ObjNrT objnr)
 
static IDWithGroup getInvalid ()
 
static bool isValidString (const char *)
 
static IDWithGroup getFromString (const char *)
 
static IDWithGroup getFromInt64 (int64_t)
 

Protected Member Functions

 IDWithGroup (GroupNrT gnr, ObjNrT onr)
 

Protected Attributes

GroupNrT groupnr_
 
ObjNrT objnr_
 

Detailed Description

template<class GroupNrT, class ObjNrT>
class IDWithGroup< GroupNrT, ObjNrT >

A unique identifier for an object consisting of a group and an ID within the group.

In many places there is a need for an ID consisting of not only an object ID but also a group ID. If the groups were closed, an enum would be sufficient. But if the number of groups is not fixed (e.g. because they are in a factory) then both group ID and the object ID need to be integer numbers.

Usually there are a lot less groups than possible objects, so the group ID can be represented by a short int.

The most standard GroupedID class (used for o.a. DataPack IDs) is a typedef for IDWithGroup<short,int>.

Member Typedef Documentation

template<class GroupNrT, class ObjNrT>
typedef GroupNrT IDWithGroup< GroupNrT, ObjNrT >::GroupNrType
template<class GroupNrT, class ObjNrT>
typedef ObjNrT IDWithGroup< GroupNrT, ObjNrT >::ObjNrType

Constructor & Destructor Documentation

template<class GroupNrT, class ObjNrT>
IDWithGroup< GroupNrT, ObjNrT >::IDWithGroup ( )
inline
template<class GroupNrT, class ObjNrT>
IDWithGroup< GroupNrT, ObjNrT >::IDWithGroup ( GroupID  gid,
ObjID  oid 
)
inline
template<class GroupNrT, class ObjNrT>
virtual IDWithGroup< GroupNrT, ObjNrT >::~IDWithGroup ( )
inlinevirtual
template<class GroupNrT, class ObjNrT>
IDWithGroup< GroupNrT, ObjNrT >::IDWithGroup ( GroupNrT  gnr,
ObjNrT  onr 
)
inlineprotected

Member Function Documentation

template<class GroupNrT , class ObjNrT >
void IDWithGroup< GroupNrT, ObjNrT >::fromInt64 ( int64_t  i64)
inlinevirtual
template<class GroupNrT , class ObjNrT >
void IDWithGroup< GroupNrT, ObjNrT >::fromString ( const char *  str)
inlinevirtual

Reimplemented in DBKey.

template<class GroupNrT, class ObjNrT>
static IDWithGroup IDWithGroup< GroupNrT, ObjNrT >::get ( GroupNrT  grpnr,
ObjNrT  objnr 
)
inlinestatic
template<class GroupNrT , class ObjNrT >
IDWithGroup< GroupNrT, ObjNrT > IDWithGroup< GroupNrT, ObjNrT >::getFromInt64 ( int64_t  i64)
inlinestatic
template<class GroupNrT , class ObjNrT >
IDWithGroup< GroupNrT, ObjNrT > IDWithGroup< GroupNrT, ObjNrT >::getFromString ( const char *  str)
inlinestatic
template<class GroupNrT, class ObjNrT>
static IDWithGroup IDWithGroup< GroupNrT, ObjNrT >::getInvalid ( )
inlinestatic
template<class GroupNrT, class ObjNrT>
GroupID IDWithGroup< GroupNrT, ObjNrT >::groupID ( ) const
inline
template<class GroupNrT, class ObjNrT>
GroupNrT IDWithGroup< GroupNrT, ObjNrT >::groupNr ( ) const
inline
template<class GroupNrT, class ObjNrT>
bool IDWithGroup< GroupNrT, ObjNrT >::hasValidGroupID ( ) const
inline
template<class GroupNrT, class ObjNrT>
bool IDWithGroup< GroupNrT, ObjNrT >::hasValidObjID ( ) const
inline
template<class GroupNrT, class ObjNrT>
virtual bool IDWithGroup< GroupNrT, ObjNrT >::isInvalid ( ) const
inlinevirtual

Reimplemented in DBKey.

template<class GroupNrT, class ObjNrT>
bool IDWithGroup< GroupNrT, ObjNrT >::isValid ( ) const
inline
template<class GroupNrT , class ObjNrT >
bool IDWithGroup< GroupNrT, ObjNrT >::isValidString ( const char *  str)
inlinestatic
template<class GroupNrT, class ObjNrT>
ObjID IDWithGroup< GroupNrT, ObjNrT >::objID ( ) const
inline
template<class GroupNrT, class ObjNrT>
ObjNrT IDWithGroup< GroupNrT, ObjNrT >::objNr ( ) const
inline
template<class GroupNrT, class ObjNrT>
bool IDWithGroup< GroupNrT, ObjNrT >::operator!= ( const IDWithGroup< GroupNrT, ObjNrT > &  oth) const
inline
template<class GroupNrT, class ObjNrT>
bool IDWithGroup< GroupNrT, ObjNrT >::operator== ( const IDWithGroup< GroupNrT, ObjNrT > &  oth) const
inline
template<class GroupNrT, class ObjNrT>
void IDWithGroup< GroupNrT, ObjNrT >::setGroupID ( GroupID  id)
inline
template<class GroupNrT, class ObjNrT>
void IDWithGroup< GroupNrT, ObjNrT >::setGroupNr ( GroupNrT  nr)
inline
template<class GroupNrT, class ObjNrT>
void IDWithGroup< GroupNrT, ObjNrT >::setInvalid ( )
inline
template<class GroupNrT, class ObjNrT>
void IDWithGroup< GroupNrT, ObjNrT >::setInvalidGroup ( )
inline
template<class GroupNrT, class ObjNrT>
void IDWithGroup< GroupNrT, ObjNrT >::setInvalidObj ( )
inline
template<class GroupNrT, class ObjNrT>
void IDWithGroup< GroupNrT, ObjNrT >::setObjID ( ObjID  id)
inline
template<class GroupNrT, class ObjNrT>
void IDWithGroup< GroupNrT, ObjNrT >::setObjNr ( ObjNrT  nr)
inline
template<class GroupNrT , class ObjNrT >
int64_t IDWithGroup< GroupNrT, ObjNrT >::toInt64 ( ) const
inlinevirtual
template<class GroupNrT , class ObjNrT >
BufferString IDWithGroup< GroupNrT, ObjNrT >::toString ( ) const
inlinevirtual

Reimplemented in DBKey.

Member Data Documentation

template<class GroupNrT, class ObjNrT>
GroupNrT IDWithGroup< GroupNrT, ObjNrT >::groupnr_
protected
template<class GroupNrT, class ObjNrT>
ObjNrT IDWithGroup< GroupNrT, ObjNrT >::objnr_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2017