34 #include "xc_utils/src/kernel/CommandEntity.h" 37 #include "utility/actor/actor/MovableID.h" 38 #include <boost/iterator/indirect_iterator.hpp> 56 class DqPtrs:
public CommandEntity,
protected std::deque<T *>
59 typedef typename std::deque<T *> lst_ptr;
60 typedef typename lst_ptr::const_iterator const_iterator;
61 typedef typename lst_ptr::iterator iterator;
62 typedef typename lst_ptr::reference reference;
63 typedef typename lst_ptr::const_reference const_reference;
64 typedef typename lst_ptr::size_type size_type;
65 typedef boost::indirect_iterator<iterator> indIterator;
67 DqPtrs(CommandEntity *owr=
nullptr);
69 explicit DqPtrs(
const std::deque<T *> &ts);
70 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 : CommandEntity(owr),lst_ptr() {}
118 : CommandEntity(other), lst_ptr(other)
124 : CommandEntity(), lst_ptr(ts)
130 : CommandEntity(), 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 CommandEntity::operator=(other);
143 lst_ptr::operator=(other);
161 for(
register const_iterator i= other.begin();i!=other.end();i++)
168 { lst_ptr::clear(); }
175 CommandEntity::clearPyProps();
182 const T *ptr= lst_ptr::at(i);
191 for(const_iterator i= begin();i!= end();i++)
207 if(find(begin(),end(),t) == end())
209 lst_ptr::push_back(t);
214 std::cerr << getClassName() <<
"::" << __FUNCTION__
215 <<
"; attempt to insert a null pointer." << std::endl;
225 if(find(begin(),end(),t) == end())
227 lst_ptr::push_front(t);
232 std::cerr << getClassName() <<
"::" << __FUNCTION__
233 <<
"; attempt to insert a null pointer." << std::endl;
242 const int sz= size();
248 for(const_iterator i= begin();i!=end();i++)
250 retval(loc)= (*i)->getTag();
261 const int sz= size();
265 const ID &tags= getTags();
269 std::cerr <<
"DqPtrs<T>::sendDbTags - failed to send the IDs.\n";
286 std::cerr <<
"DqPtrs<T>::receiveTags - failed to receive the IDs.\n";
DqPtrs & operator=(const DqPtrs &)
Assignment operator.
Definition: DqPtrs.h:140
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:43
Vector of integers.
Definition: ID.h:93
DqPtrs(CommandEntity *owr=nullptr)
Constructor.
Definition: DqPtrs.h:112
int receiveID(ID &v, const int &) const
Receives el vector.
Definition: CommParameters.cc:79
int receiveInt(int &, DbTagData &, const CommMetaData &) const
Receives the integers through the channel being passed as parameter.
Definition: CommParameters.cc:857
DqPtrs & operator+=(const DqPtrs &)
+= (union) operator.
Definition: DqPtrs.h:149
const ID & getTags(void) const
Returns the tags of the objects.
Definition: DqPtrs.h:239
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:275
int sendInt(const int &, DbTagData &, const CommMetaData &)
Sends the integer through the channel being passed as parameter.
Definition: CommParameters.cc:803
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:259
void clearAll(void)
Clears out the list of pointers and erases the properties of the object (if any). ...
Definition: DqPtrs.h:172
int sendID(const ID &, const int &)
Sends vector.
Definition: CommParameters.cc:72
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Communication parameters between processes.
Definition: CommParameters.h:65
void clear(void)
Clears out the list of pointers.
Definition: DqPtrs.h:167
Pointer to (nodes, elements, points, lines,...) container.
Definition: DqPtrs.h:56
bool in(const T *) const
Returns true if the pointer is in the container.
Definition: DqPtrs.h:188
void extend(const DqPtrs &)
Extend this container with the pointers from the container being passed as parameter.
Definition: DqPtrs.h:159