34 #include "xc_utils/src/nucleo/EntCmd.h" 35 #include "xc_utils/src/nucleo/EntPropSorter.h" 38 #include "utility/actor/actor/MovableID.h" 39 #include <boost/iterator/indirect_iterator.hpp> 57 class DqPtrs:
public EntCmd,
protected std::deque<T *>
60 typedef typename std::deque<T *> lst_ptr;
61 typedef typename lst_ptr::const_iterator const_iterator;
62 typedef typename lst_ptr::iterator iterator;
63 typedef typename lst_ptr::reference reference;
64 typedef typename lst_ptr::const_reference const_reference;
65 typedef typename lst_ptr::size_type size_type;
66 typedef boost::indirect_iterator<iterator> indIterator;
68 DqPtrs(EntCmd *owr=
nullptr);
70 explicit DqPtrs(
const std::deque<T *> &ts);
71 explicit DqPtrs(
const std::set<const T *> &ts);
77 inline bool empty(
void)
const 78 {
return lst_ptr::empty(); }
79 inline iterator begin(
void)
80 {
return lst_ptr::begin(); }
81 const_iterator begin(
void)
const 82 {
return lst_ptr::begin(); }
84 {
return lst_ptr::end(); }
85 const_iterator end(
void)
const 86 {
return lst_ptr::end(); }
87 inline indIterator indBegin(
void)
88 {
return indIterator(lst_ptr::begin()); }
89 inline indIterator indEnd(
void)
90 {
return indIterator(lst_ptr::end()); }
91 const T &
get(
const size_t &i)
const;
94 inline size_type size(
void)
const 95 {
return lst_ptr::size(); }
96 bool in(
const T *)
const;
100 template <
class InputIterator>
101 void insert(iterator pos, InputIterator f, InputIterator l)
102 { lst_ptr::insert(pos,f,l); }
113 : EntCmd(owr),lst_ptr() {}
118 : EntCmd(otro), lst_ptr(otro)
124 : EntCmd(), lst_ptr(ts)
130 : EntCmd(), lst_ptr()
132 typename std::set<const T *>::const_iterator k;
134 for(;k!=st.end();k++)
135 lst_ptr::push_back(const_cast<T *>(*k));
142 EntCmd::operator=(otro);
143 lst_ptr::operator=(otro);
152 for(
register const_iterator i= otro.begin();i!=otro.end();i++)
159 { lst_ptr::clear(); }
166 EntCmd::clearPyProps();
173 const T *ptr= lst_ptr::at(i);
182 for(const_iterator i= begin();i!= end();i++)
198 if(find(begin(),end(),t) == end())
200 lst_ptr::push_back(t);
205 std::cerr << nombre_clase() <<
"::" << __FUNCTION__
206 <<
"; attempt to insert a null pointer." << std::endl;
216 if(find(begin(),end(),t) == end())
218 lst_ptr::push_front(t);
223 std::cerr << nombre_clase() <<
"::" << __FUNCTION__
224 <<
"; attempt to insert a null pointer." << std::endl;
233 const int sz= size();
239 for(const_iterator i= begin();i!=end();i++)
241 retval(loc)= (*i)->getTag();
252 const int sz= size();
260 std::cerr <<
"DqPtrs<T>::sendDbTags - failed to send the IDs.\n";
277 std::cerr <<
"DqPtrs<T>::receiveTags - failed to receive the IDs.\n";
Pointer to (nodes, elements, points, lines,...) container.
Definition: DqPtrs.h:57
const ID & receiveTags(int posSz, int pDbTg, DbTagData &dt, const CommParameters &cp)
Sends the dbTags of the sets through the channel being passed as parameter.
Definition: DqPtrs.h:266
DqPtrs(EntCmd *owr=nullptr)
Constructor.
Definition: DqPtrs.h:112
void clear(void)
Clears out the list of pointers.
Definition: DqPtrs.h:158
Vector que almacena los dbTags de los miembros de la clase.
Definition: DbTagData.h:43
int sendID(const ID &, const int &)
Sends vector.
Definition: CommParameters.cc:72
const ID & getTags(void) const
Returns the Tags de los objetos.
Definition: DqPtrs.h:230
DqPtrs & operator=(const DqPtrs &)
Assignment operator.
Definition: DqPtrs.h:140
int receiveID(ID &v, const int &) const
Recibe el vector.
Definition: CommParameters.cc:79
int receiveInt(int &, DbTagData &, const CommMetaData &) const
Recibe the integers through the channel being passed as parameter.
Definition: CommParameters.cc:751
int sendTags(int posSz, int posDbTag, DbTagData &dt, CommParameters &cp)
Sends the dbTags of the sets trough the channel being passed as parameter.
Definition: DqPtrs.h:250
void clearAll(void)
Clears out the list of pointers and erases the properties of the object (if any). ...
Definition: DqPtrs.h:163
bool in(const T *) const
Returns true if the pointer is in the container.
Definition: DqPtrs.h:179
int sendInt(const int &, DbTagData &, const CommMetaData &)
Sends the integer through the channel being passed as parameter.
Definition: CommParameters.cc:697
void extend(const DqPtrs &)
Extend this container with the pointers from the container being passed as parameter.
Definition: DqPtrs.h:150
Communication parameters between processes.
Definition: CommParameters.h:65
================================================================================
Definition: ContinuaReprComponent.h:34
const T & get(const size_t &i) const
Access specified node with bounds checking.
Definition: DqPtrs.h:171