Loading...
Searching...
No Matches
multicnt.h
Go to the documentation of this file.
// ----------------------------------------------------------------------------
// multicnt.h
// begin of file
// Stephan Endrass, endrass@mathematik.uni-mainz.de
// 23.7.99
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Description: the class multiCnt is a general multi purpose counter.
// The counter holds an array cnt of N integers.
// The integer last_inc holds the index of the last incremented entry.
// ----------------------------------------------------------------------------
#ifndef MULTICNT_H
#define MULTICNT_H
class multiCnt
{
public:
int *cnt;
int N;
int last_inc;
multiCnt( );
multiCnt( int );
multiCnt( int,int );
multiCnt( int,int* );
multiCnt( const multiCnt& );
void copy_zero ( void );
void copy_new ( int );
void copy_delete ( void );
void copy_shallow( multiCnt& );
void copy_deep ( const multiCnt& );
void set( int );
void inc ( void );
void inc_carry( void );
int inc ( int );
//void dec ( void );
//void dec_carry( void );
//int dec ( int );
};
// ----------------------------------------------------------------------------
// zero init
// ----------------------------------------------------------------------------
inline void multiCnt::copy_zero( void )
{
cnt = (int*)NULL;
N = 0;
last_inc = 0;
}
// ----------------------------------------------------------------------------
// copy a counter by reference
// ----------------------------------------------------------------------------
inline void multiCnt::copy_shallow( multiCnt &C )
{
cnt = C.cnt;
N = C.N;
last_inc = C.last_inc;
}
// ----------------------------------------------------------------------------
// zero constructor
// ----------------------------------------------------------------------------
inline multiCnt::multiCnt( )
{
copy_zero( );
}
#endif /* MULTICNT_H */
// ----------------------------------------------------------------------------
// multicnt.h
// end of file
// ----------------------------------------------------------------------------
multiCnt::copy_zero
void copy_zero(void)
Definition multicnt.h:51
multiCnt::copy_new
void copy_new(int)
Definition multicnt.cc:32
multiCnt::cnt
int * cnt
Definition multicnt.h:21
multiCnt::set
void set(int)
Definition multicnt.cc:108
multiCnt::copy_deep
void copy_deep(const multiCnt &)
Definition multicnt.cc:91
multiCnt::last_inc
int last_inc
Definition multicnt.h:23
multiCnt::inc_carry
void inc_carry(void)
Definition multicnt.cc:176
multiCnt::copy_delete
void copy_delete(void)
Definition multicnt.cc:81
multiCnt::multiCnt
multiCnt()
Definition multicnt.h:73
multiCnt::inc
void inc(void)
Definition multicnt.cc:154
multiCnt::multiCnt
multiCnt(const multiCnt &)
multiCnt::N
int N
Definition multicnt.h:22
multiCnt::copy_shallow
void copy_shallow(multiCnt &)
Definition multicnt.h:62
NULL
#define NULL
Definition omList.c:12