00001
00002
00028
00029
00030
00031 #include "pbori_defs.h"
00032
00033
00034 #include "pbori_func.h"
00035 #include "pbori_algo.h"
00036
00037 #include "CStringLiteral.h"
00038 #include "CPrintOperation.h"
00039
00040
00041
00042 #ifndef CIdxVariable_h_
00043 #define CIdxVariable_h_
00044
00050 BEGIN_NAMESPACE_PBORI
00051
00052 template <class IdxType = CTypes::idx_type,
00053 class VarNameLit =
00054 CStringLiteral<CLiteralCodes::default_variable_name>,
00055 class VarHeadLit =
00056 CStringLiteral<CLiteralCodes::variable_head>,
00057 class VarTailLit =
00058 CStringLiteral<CLiteralCodes::variable_tail> >
00059 class CIdxVariable {
00060
00061 public:
00063
00064 typedef IdxType idx_type;
00065 typedef CTypes::ostream_type ostream_type;
00067
00069 typedef CIdxVariable<idx_type, VarNameLit, VarHeadLit, VarTailLit> self;
00070
00072 CIdxVariable(idx_type idx_ = 0): idx(idx_) {};
00073
00075 CIdxVariable(const self& rhs): idx(rhs.idx) {};
00076
00078 ~CIdxVariable() {};
00079
00081 ostream_type& print(ostream_type& os) const {
00082
00083 os << VarNameLit()() << VarHeadLit()() << idx << VarTailLit()();
00084
00085 return os;
00086 }
00087
00088 protected:
00089 idx_type idx;
00090 };
00091
00093 template <class IdxType, class VarNameLit, class VarHeadLit, class VarTailLit>
00094 inline typename
00095 CIdxVariable<IdxType, VarNameLit, VarHeadLit, VarTailLit>::ostream_type&
00096 operator<<(typename CIdxVariable<IdxType,
00097 VarNameLit, VarHeadLit, VarTailLit>::ostream_type& os,
00098 const CIdxVariable<IdxType,
00099 VarNameLit, VarHeadLit, VarTailLit>& storage){
00100
00101 return storage.print(os);
00102 }
00103
00104 END_NAMESPACE_PBORI
00105
00106 #endif