67 #include "utility/kernel/CommandEntity.h" 70 #include <boost/python/list.hpp> 98 typedef std::vector<int> v_int;
100 static int ID_NOT_VALID_ENTRY;
104 explicit ID(
const int &);
105 explicit ID(
const v_int &);
106 ID(
const boost::python::list &);
107 explicit ID(
const std::set<int> &);
108 template <
class InputIterator>
109 inline ID(InputIterator first, InputIterator last)
111 inline virtual ~
ID(){}
120 {
return &(*this)[0]; }
123 {
return &(*this)[0]; }
127 int resize(
const int &newSize,
const int &fill_value= 0);
128 void fill(
const int &fill_value);
129 const int &
max(
void)
const;
130 const int &
min(
void)
const;
138 {
return this->at(i); }
142 {
return this->at(i); }
146 int getLocationOrdered(
const int &)
const;
152 boost::python::list
getPyList(
void)
const;
153 void setPyList(
const boost::python::list &);
154 boost::python::dict
getPyDict(
void)
const;
155 void setPyDict(
const boost::python::dict &);
157 friend std::ostream &operator<<(std::ostream &,
const ID &);
167 ID getIDFromIntPtr(
const int *,
const int &);
169 std::ostream &operator<<(std::ostream &,
const ID &);
174 const int sz=
Size();
175 if((i < 0) || (i >= sz))
177 std::cerr <<
"ID::(loc) - loc " 178 << i <<
" outside range 0 - " << sz-1 << std::endl;
193 return ID_NOT_VALID_ENTRY;
206 return ID_NOT_VALID_ENTRY;
bool isEmpty(void) const
Returns true if the vector is empty.
Definition: ID.h:125
boost::python::list getPyList(void) const
Return the vector values in a Python list.
Definition: ID.cpp:241
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:188
int resize(const int &newSize, const int &fill_value=0)
Changes the size of the array.
Definition: ID.cpp:187
Vector of integers.
Definition: ID.h:95
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:119
const int & min(void) const
Returns the minimum of vector components.
Definition: ID.cpp:216
TCP_SocketNoDelay is a sub-class of channel.
Definition: TCP_SocketNoDelay.h:73
int * getDataPtr(void)
Returns a const pointer to the vector data.
Definition: ID.h:122
Objet that can execute python scripts.
Definition: CommandEntity.h:40
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: ID.cpp:262
MPI_Channel is a sub-class of channel.
Definition: MPI_Channel.h:70
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
void reverse(void)
Reverse sequence.
Definition: ID.cpp:175
void fill(const int &fill_value)
Fills the array with the argument.
Definition: ID.cpp:204
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:137
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:141
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:172
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: ID.cpp:270
ID getReversed(void) const
Return the reversed sequence.
Definition: ID.cpp:179
void setPyList(const boost::python::list &)
Populate the vector with the values of the given list.
Definition: ID.cpp:251
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:212
CommandEntity(CommandEntity *owr=nullptr)
Default constructor.
Definition: CommandEntity.cc:40
int Size(void) const
Returns the vector size.
Definition: ID.h:115
ID(void)
Default constructor, sets size = 0;.
Definition: ID.cpp:68