CARMA C++
sza::util::AntNum Class Reference

A class to enumerate a single Antenna, or a set of Antennas. More...

#include <carma/szautil/AntNum.h>

Public Types

enum  Id {
  ANTNONE = 0, ANT0 = 1, ANT1 = 2, ANT2 = 4,
  ANT3 = 8, ANT4 = 16, ANT5 = 32, ANT6 = 64,
  ANT7 = 128, ANTMAX = ANT7, SPARE = 256, ANTALL = ANT0 | ANT1 | ANT2 | ANT3 | ANT4 | ANT5 | ANT6 | ANT7
}
 Enumerate known receivers. More...
 

Public Member Functions

 AntNum (Id id)
 Constructor with Antenna enumerator. More...
 
 AntNum (unsigned int)
 Constructor with Antenna number as int. More...
 
 AntNum ()
 Constructor with uninitialized antenna. More...
 
 AntNum (const AntNum &antNum)
 Copy constructor. More...
 
 AntNum (AntNum *antNum)
 Copy constructor. More...
 
std::string getAntennaName ()
 Return a board name in the register database constructed from this Antenna enumerator. More...
 
unsigned int getAntMax ()
 Return the maximum number of antennas we know about. More...
 
unsigned short getCarmaAntennaIndex ()
 
unsigned short getDcAntennaIndex ()
 Return an integer antenna index suitable for passing to downconverter API methods. More...
 
unsigned short getDcNodeIndex ()
 
unsigned int getDelayEngineIntId ()
 Return an integer antenna index associated with this enumerator, as expected by the delay engine. More...
 
std::string getEventChannelName ()
 Return a CORBA object name constructed from this Antenna enumerator. More...
 
Id getId ()
 Return the antenna id associated with this enumerator. More...
 
unsigned int getIntId ()
 Return an integer antenna index associated with this enumerator. More...
 
std::string getLoggerPrefix ()
 Return a prefix suitable for use in logging. More...
 
std::string getObjectName ()
 Return a CORBA object name constructed from this Antenna enumerator. More...
 
std::string getString ()
 Return a string representation of this antenna set. More...
 
bool isSet (unsigned id)
 Return true if the passed id is part of this object's antenna set. More...
 
bool isSet (AntNum::Id id)
 Return true if the passed id is part of this object's antenna set. More...
 
bool isSet (AntNum &antNum)
 Return true if the passed AntNum's id is part of this object's antenna set. More...
 
bool isSet (AntNum *antNum)
 Return true if the passed AntNum's id is part of this object's antenna set. More...
 
bool isValidSingleAnt ()
 Check if this object specifies a valid single receiver. More...
 
const AntNum operator+ (const AntNum &rx)
 Add two antenna enumerators. More...
 
const AntNumoperator++ ()
 Prefix increment. More...
 
const AntNum operator++ (int)
 Postfix increment. More...
 
bool operator< (const AntNum rx)
 Define < for two antenna enumerators. More...
 
bool operator<= (const AntNum rx)
 Define <= for two antenna enumerators. More...
 
bool operator== (const AntNum rx)
 Define equality for two antenna enumerators. More...
 
bool operator> (const AntNum rx)
 Define > for two antenna enumerators. More...
 
bool operator>= (const AntNum rx)
 Define >= for two antenna enumerators. More...
 
std::string printAntennaSet ()
 Return a string representing an antenna set. More...
 
std::string printAntennaSet (AntNum::Id id)
 
void set (AntNum::Id id)
 Set the antennas represented by this object. More...
 
void setId (AntNum::Id)
 Set the id of this antenna enumerator. More...
 
void setId (unsigned int id)
 Set the id of this antenna enumerator. More...
 
void setId (const AntNum &antNum)
 Set the id of this antenna enumerator. More...
 
void setIdFromHost ()
 Set the id of this antenna enumerator from the name of the host machine. More...
 

Static Public Member Functions

static unsigned idToInt (AntNum::Id id)
 Convert from integer index to enumerator. More...
 
static AntNum::Id intToId (unsigned int iant)
 Convert from integer index to enumerator. More...
 
static bool isValidSingleAnt (Id antId)
 

Public Attributes

enum sza::util::AntNum::Id id_
 

Static Public Attributes

static const unsigned int NANT = 8
 
static const unsigned int NBASE = (NANT*(NANT-1))/2
 

Friends

unsigned idToInt (AntNum::Id id)
 Convert from integer index to enumerator. More...
 
AntNum::Id intToId (unsigned int iant)
 Convert from integer index to enumerator. More...
 
bool isValidAnt (unsigned int ant)
 Return true if the passed index specifies a valid receiver. More...
 
bool isValidAntennaSet (AntNum::Id antennas)
 Return true if the passed index specifies a valid antenna set. More...
 
AntNum::Id operator+ (const AntNum::Id id1, const AntNum::Id id2)
 Allows expressions like ANT0+ANT1. More...
 
AntNum::Id operator- (const AntNum::Id id1, const AntNum::Id id2)
 Allows expressions like ANTALL-ANT1. More...
 
std::ostream & operator<< (std::ostream &os, const AntNum &rx)
 Allows cout << ant. More...
 
std::string printAntennaSet (AntNum::Id antennas)
 Return a string representing an antenna set. More...
 

Detailed Description

A class to enumerate a single Antenna, or a set of Antennas.

Definition at line 21 of file AntNum.h.

Member Enumeration Documentation

Enumerate known receivers.

Definition at line 35 of file AntNum.h.

Constructor & Destructor Documentation

sza::util::AntNum::AntNum ( Id  id)

Constructor with Antenna enumerator.

sza::util::AntNum::AntNum ( unsigned  int)

Constructor with Antenna number as int.

Exceptions
Exception
sza::util::AntNum::AntNum ( )

Constructor with uninitialized antenna.

sza::util::AntNum::AntNum ( const AntNum antNum)

Copy constructor.

Exceptions
Exception
sza::util::AntNum::AntNum ( AntNum antNum)

Copy constructor.

Exceptions
Exception

Member Function Documentation

std::string sza::util::AntNum::getAntennaName ( )

Return a board name in the register database constructed from this Antenna enumerator.

unsigned int sza::util::AntNum::getAntMax ( )

Return the maximum number of antennas we know about.

unsigned short sza::util::AntNum::getDcAntennaIndex ( )

Return an integer antenna index suitable for passing to downconverter API methods.

Exceptions
Exceptionif this enumerator does not represent a single valid antenna.
unsigned int sza::util::AntNum::getDelayEngineIntId ( )

Return an integer antenna index associated with this enumerator, as expected by the delay engine.

Exceptions
Exceptionif this enumerator does not represent a single valid antenna.
std::string sza::util::AntNum::getEventChannelName ( )

Return a CORBA object name constructed from this Antenna enumerator.

Id sza::util::AntNum::getId ( )

Return the antenna id associated with this enumerator.

unsigned int sza::util::AntNum::getIntId ( )

Return an integer antenna index associated with this enumerator.

Exceptions
Exceptionif this enumerator does not represent a single valid antenna.
std::string sza::util::AntNum::getLoggerPrefix ( )

Return a prefix suitable for use in logging.

std::string sza::util::AntNum::getObjectName ( )

Return a CORBA object name constructed from this Antenna enumerator.

std::string sza::util::AntNum::getString ( )

Return a string representation of this antenna set.

static unsigned sza::util::AntNum::idToInt ( AntNum::Id  id)
static

Convert from integer index to enumerator.

static AntNum::Id sza::util::AntNum::intToId ( unsigned int  iant)
static

Convert from integer index to enumerator.

bool sza::util::AntNum::isSet ( unsigned  id)

Return true if the passed id is part of this object's antenna set.

bool sza::util::AntNum::isSet ( AntNum::Id  id)

Return true if the passed id is part of this object's antenna set.

bool sza::util::AntNum::isSet ( AntNum antNum)

Return true if the passed AntNum's id is part of this object's antenna set.

bool sza::util::AntNum::isSet ( AntNum antNum)

Return true if the passed AntNum's id is part of this object's antenna set.

bool sza::util::AntNum::isValidSingleAnt ( )

Check if this object specifies a valid single receiver.

const AntNum sza::util::AntNum::operator+ ( const AntNum rx)

Add two antenna enumerators.

const AntNum& sza::util::AntNum::operator++ ( )

Prefix increment.

const AntNum sza::util::AntNum::operator++ ( int  )

Postfix increment.

bool sza::util::AntNum::operator< ( const AntNum  rx)

Define < for two antenna enumerators.

bool sza::util::AntNum::operator<= ( const AntNum  rx)

Define <= for two antenna enumerators.

bool sza::util::AntNum::operator== ( const AntNum  rx)

Define equality for two antenna enumerators.

bool sza::util::AntNum::operator> ( const AntNum  rx)

Define > for two antenna enumerators.

bool sza::util::AntNum::operator>= ( const AntNum  rx)

Define >= for two antenna enumerators.

std::string sza::util::AntNum::printAntennaSet ( )

Return a string representing an antenna set.

void sza::util::AntNum::set ( AntNum::Id  id)

Set the antennas represented by this object.

void sza::util::AntNum::setId ( AntNum::Id  )

Set the id of this antenna enumerator.

void sza::util::AntNum::setId ( unsigned int  id)

Set the id of this antenna enumerator.

void sza::util::AntNum::setId ( const AntNum antNum)

Set the id of this antenna enumerator.

void sza::util::AntNum::setIdFromHost ( )

Set the id of this antenna enumerator from the name of the host machine.

Friends And Related Function Documentation

unsigned idToInt ( AntNum::Id  id)
friend

Convert from integer index to enumerator.

AntNum::Id intToId ( unsigned int  iant)
friend

Convert from integer index to enumerator.

bool isValidAnt ( unsigned int  ant)
friend

Return true if the passed index specifies a valid receiver.

bool isValidAntennaSet ( AntNum::Id  antennas)
friend

Return true if the passed index specifies a valid antenna set.

AntNum::Id operator+ ( const AntNum::Id  id1,
const AntNum::Id  id2 
)
friend

Allows expressions like ANT0+ANT1.

AntNum::Id operator- ( const AntNum::Id  id1,
const AntNum::Id  id2 
)
friend

Allows expressions like ANTALL-ANT1.

std::ostream& operator<< ( std::ostream &  os,
const AntNum rx 
)
friend

Allows cout << ant.

std::string printAntennaSet ( AntNum::Id  antennas)
friend

Return a string representing an antenna set.


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