OpendTect  6.3
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
IntegerID< IntType > Class Template Reference

single integer ID with comparison but no automatic conversion. Note that you will want to make a subclass to make the IDs specific for your class. Therefore, use the mDefIntegerID macro. More...

Inheritance diagram for IntegerID< IntType >:
[legend]

Public Types

typedef IntType IDType
 

Public Member Functions

 IntegerID ()
 
IntType getI () const
 
void setI (IntType i)
 
bool operator== (const IntegerID &oth) const
 
bool operator!= (const IntegerID &oth) const
 
bool isInvalid () const
 
bool isValid () const
 
void setInvalid ()
 

Static Public Member Functions

static IntegerID get (IntType i)
 
static IntegerID getInvalid ()
 

Protected Member Functions

 IntegerID (IntType i)
 

Protected Attributes

IntType nr_
 

Friends

class TypeSet< IntType >
 

Detailed Description

template<class IntType>
class IntegerID< IntType >

single integer ID with comparison but no automatic conversion. Note that you will want to make a subclass to make the IDs specific for your class. Therefore, use the mDefIntegerID macro.

typedef IntegerID<int> ID;

void dummy( ID id ) { id.setI( 666 ); // fine id = 666; // nope id += 666; // nope (good thing) id.setI( id.getI() + 666 ); // fine (weird, but you wanted it) }

void dummy2() { dummy( ID::get(555) ); // fine dummy( 555 ); // nope }

class X { X(); ID id_; };

X::X() : id_(ID::get(444)) {} // fine X::X() : id_(444) {} // nope X::X() {} // nope

Member Typedef Documentation

template<class IntType>
typedef IntType IntegerID< IntType >::IDType

Constructor & Destructor Documentation

template<class IntType>
IntegerID< IntType >::IntegerID ( )
inline
template<class IntType>
IntegerID< IntType >::IntegerID ( IntType  i)
inlineprotected

Member Function Documentation

template<class IntType>
static IntegerID IntegerID< IntType >::get ( IntType  i)
inlinestatic
template<class IntType>
IntType IntegerID< IntType >::getI ( ) const
inline
template<class IntType>
static IntegerID IntegerID< IntType >::getInvalid ( )
inlinestatic
template<class IntType>
bool IntegerID< IntType >::isInvalid ( ) const
inline
template<class IntType>
bool IntegerID< IntType >::isValid ( ) const
inline
template<class IntType>
bool IntegerID< IntType >::operator!= ( const IntegerID< IntType > &  oth) const
inline
template<class IntType>
bool IntegerID< IntType >::operator== ( const IntegerID< IntType > &  oth) const
inline
template<class IntType>
void IntegerID< IntType >::setI ( IntType  i)
inline
template<class IntType>
void IntegerID< IntType >::setInvalid ( )
inline

Friends And Related Function Documentation

template<class IntType>
friend class TypeSet< IntType >
friend

Member Data Documentation

template<class IntType>
IntType IntegerID< IntType >::nr_
protected

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