CCheckedIdx.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_common_CCheckedIdx_h_
#define polybori_common_CCheckedIdx_h_
// include basic definitions
#include <polybori/pbori_defs.h>
BEGIN_NAMESPACE_PBORI
class CCheckedIdx:
public CTypes::auxtypes_type {
typedef CCheckedIdx self;
public:
CCheckedIdx(idx_type idx): m_idx(idx) {
if PBORI_UNLIKELY(idx < 0) handle_error();
}
CCheckedIdx(const self& rhs): m_idx(rhs.m_idx) { }
~CCheckedIdx() {}
operator idx_type() const { return m_idx; }
private:
void handle_error() const;
idx_type m_idx;
};
END_NAMESPACE_PBORI
#endif
END_NAMESPACE_PBORI
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
BEGIN_NAMESPACE_PBORI
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
polybori::CAuxTypes
This struct contains auxiliary type definitions.
Definition: pbori_defs.h:210
pbori_defs.h
polybori::CCheckedIdx::CCheckedIdx
CCheckedIdx(idx_type idx)
Definition: CCheckedIdx.h:36
polybori::CCheckedIdx::~CCheckedIdx
~CCheckedIdx()
Definition: CCheckedIdx.h:40
polybori::CAuxTypes::idx_type
int idx_type
Type for indices.
Definition: pbori_defs.h:228
polybori::CCheckedIdx::CCheckedIdx
CCheckedIdx(const self &rhs)
Definition: CCheckedIdx.h:39
polybori::groebner::idx_type
polybori::CTypes::idx_type idx_type
Definition: groebner_defs.h:44
PBORI_UNLIKELY
#define PBORI_UNLIKELY(expression)
Definition: pbori_defs.h:59
polybori::CCheckedIdx
This class defines CCheckedIdx.
Definition: CCheckedIdx.h:29