Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends | List of all members
Mantid::Geometry::RotaryCounter Class Reference

Simple multilevel-cyclic counter. More...

#include <RotCounter.h>

Public Member Functions

int operator++ ()
 Carrys out a rotational addition. More...
 
int operator++ (const int a)
 Convertion to ++operator (prefix) from operator++ (postfix) More...
 
int operator-- ()
 Carrys out a rotational addition. More...
 
int operator-- (const int a)
 convertion to –operator (prefix) from operator-- (postfix) More...
 
bool operator< (const RotaryCounter &) const
 Determines the precidence of the RotaryCounters Operator works on the 0 to high index. More...
 
bool operator== (const RotaryCounter &) const
 Chec to find if Counters identical in ALL respects. More...
 
bool operator> (const RotaryCounter &) const
 Determines the precidence of the RotaryCounters Operator works on the 0 to high index. More...
 
int operator[] (const int I) const
 Accessor operator. More...
 
 RotaryCounter (const int S, const int N)
 Size,Max. More...
 
void write (std::ostream &) const
 Write out object to a stream. More...
 

Private Attributes

std::vector< int > RC
 rotation list More...
 
int Rmax
 Number to over cycle. More...
 

Friends

std::ostream & operator<< (std::ostream &, const RotaryCounter &)
 Output stream assesor. More...
 

Detailed Description

Simple multilevel-cyclic counter.

Version
1.0
Date
September 2005
Author
S. Ansell

Objective is a rolling integer stream ie 1,2,3 going to 1,2,N-1 and then 1,3,4 etc...

Definition at line 28 of file RotCounter.h.

Constructor & Destructor Documentation

◆ RotaryCounter()

Mantid::Geometry::RotaryCounter::RotaryCounter ( const int  S,
const int  N 
)

Size,Max.

Simple constructor with fixed size and number.

Fills RC with a flat 0->N number list

Parameters
S:: Size (number of components)
N:: Max number to get to

Definition at line 26 of file RotCounter.cpp.

References RC.

Member Function Documentation

◆ operator++() [1/2]

int Mantid::Geometry::RotaryCounter::operator++ ( )

Carrys out a rotational addition.

Objective is a rolling integer stream ie 1,2,3 going to 1,2,N-1 and then 1,3,4 etc...

Return values
1:: the function has looped (carry flag)
0:: no loop occored

Definition at line 113 of file RotCounter.cpp.

References RC, and Rmax.

Referenced by operator++().

◆ operator++() [2/2]

int Mantid::Geometry::RotaryCounter::operator++ ( const int  a)

Convertion to ++operator (prefix) from operator++ (postfix)

Parameters
a:: ignored
Returns
++operator

Definition at line 101 of file RotCounter.cpp.

References operator++().

◆ operator--() [1/2]

int Mantid::Geometry::RotaryCounter::operator-- ( )

Carrys out a rotational addition.

Objective is a rooling integer stream ie 1,2,3 going to 1,2,N-1 and then 1,3,4 etc...

Return values
1:: the function has looped (carry flag)
0:: no loop occored

Definition at line 150 of file RotCounter.cpp.

References RC, and Rmax.

Referenced by operator--().

◆ operator--() [2/2]

int Mantid::Geometry::RotaryCounter::operator-- ( const int  a)

convertion to –operator (prefix) from operator-- (postfix)

Parameters
a:: ignored
Returns
–operator

Definition at line 138 of file RotCounter.cpp.

References operator--().

◆ operator<()

bool Mantid::Geometry::RotaryCounter::operator< ( const RotaryCounter A) const

Determines the precidence of the RotaryCounters Operator works on the 0 to high index.

Parameters
A:: RotaryCounter to compare
Returns
This < A

Definition at line 80 of file RotCounter.cpp.

◆ operator==()

bool Mantid::Geometry::RotaryCounter::operator== ( const RotaryCounter A) const

Chec to find if Counters identical in ALL respects.

Parameters
A:: Counter to compare
Return values
1:: All things identical
0:: Something not the same

Definition at line 39 of file RotCounter.cpp.

◆ operator>()

bool Mantid::Geometry::RotaryCounter::operator> ( const RotaryCounter A) const

Determines the precidence of the RotaryCounters Operator works on the 0 to high index.

Parameters
A:: RotaryCounter to compare
Returns
This > A

Definition at line 58 of file RotCounter.cpp.

◆ operator[]()

int Mantid::Geometry::RotaryCounter::operator[] ( const int  I) const
inline

Accessor operator.

Definition at line 42 of file RotCounter.h.

◆ write()

void Mantid::Geometry::RotaryCounter::write ( std::ostream &  OX) const

Write out object to a stream.

Parameters
OX:: output stream

Definition at line 179 of file RotCounter.cpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  OX,
const RotaryCounter A 
)
friend

Output stream assesor.

Parameters
OX:: Output stream
A:: RotaryCounter to writeout
Returns
the ouput stream

Definition at line 14 of file RotCounter.cpp.

Member Data Documentation

◆ RC

std::vector<int> Mantid::Geometry::RotaryCounter::RC
private

rotation list

Definition at line 33 of file RotCounter.h.

Referenced by operator++(), operator--(), and RotaryCounter().

◆ Rmax

int Mantid::Geometry::RotaryCounter::Rmax
private

Number to over cycle.

Definition at line 32 of file RotCounter.h.

Referenced by operator++(), and operator--().


The documentation for this class was generated from the following files: