66 #include "xc_utils/src/kernel/CommandEntity.h" 68 #include <boost/python/list.hpp> 93 class ID:
public CommandEntity,
public std::vector<int>
96 typedef std::vector<int> v_int;
98 static int ID_NOT_VALID_ENTRY;
102 explicit ID(
const int &);
103 explicit ID(
const v_int &);
104 ID(
const boost::python::list &);
105 explicit ID(
const std::set<int> &);
106 template <
class InputIterator>
107 inline ID(InputIterator first, InputIterator last)
108 : CommandEntity(), std::vector<int>(first,last) {}
109 inline virtual ~
ID(){}
118 {
return &(*this)[0]; }
121 {
return &(*this)[0]; }
125 int resize(
const int &newSize,
const int &defaultValue= 0);
126 const int &
max(
void)
const;
127 const int &
min(
void)
const;
135 {
return this->at(i); }
139 {
return this->at(i); }
143 int getLocationOrdered(
const int &)
const;
146 friend std::ostream &operator<<(std::ostream &,
const ID &);
156 ID getIDFromIntPtr(
const int *,
const int &);
158 std::ostream &operator<<(std::ostream &,
const ID &);
163 const int sz=
Size();
164 if((i < 0) || (i >= sz))
166 std::cerr <<
"ID::(loc) - loc " 167 << i <<
" outside range 0 - " << sz-1 << std::endl;
182 return ID_NOT_VALID_ENTRY;
195 return ID_NOT_VALID_ENTRY;
bool isEmpty(void) const
Returns true if the vector is empty.
Definition: ID.h:123
int & operator()(const int &)
Returns a reference to the element at position i in the container (does not range checking unless _G3...
Definition: ID.h:177
Vector of integers.
Definition: ID.h:93
TCP_Socket is a sub-class of channel.
Definition: TCP_Socket.h:71
const int * getDataPtr(void) const
Returns a const pointer to the vector data.
Definition: ID.h:117
const int & min(void) const
Returns the minimum of vector components.
Definition: ID.cpp:196
TCP_SocketNoDelay is a sub-class of channel.
Definition: TCP_SocketNoDelay.h:72
int * getDataPtr(void)
Returns a const pointer to the vector data.
Definition: ID.h:120
MPI_Channel is a sub-class of channel.
Definition: MPI_Channel.h:69
int getLocation(const int &) const
Returns the position of 'value' in the vector.
Definition: ID.cpp:116
int removeValue(const int &)
Remove value from the array.
Definition: ID.cpp:160
int & operator[](const int &i)
Returns a reference to the element at position i in the container (does range checking => slower than...
Definition: ID.h:134
const int & operator[](const int &i) const
Returns a reference to the element at position i in the container (does range checking => slower than...
Definition: ID.h:138
void Zero(void)
Zeros out the ID, i.e.
Definition: ID.cpp:109
bool checkRange(const int &) const
check if argument is inside range [0,sz-1]
Definition: ID.h:161
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
DP_Socket is a sub-class of channel.
Definition: UDP_Socket.h:76
const int & max(void) const
Returns the maximum of vector components.
Definition: ID.cpp:192
int Size(void) const
Returns the vector size.
Definition: ID.h:113
ID(void)
Default constructor, sets size = 0;.
Definition: ID.cpp:68