35 #include "utility/kernel/CommandEntity.h"    38 #include "utility/actor/actor/MovableID.h"    39 #include <boost/iterator/indirect_iterator.hpp>    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 typename lst_ptr::value_type value_type;
    67     typedef typename lst_ptr::difference_type difference_type;
    68     typedef boost::indirect_iterator<iterator> indIterator;
    72     explicit DqPtrs(
const std::deque<T *> &ts);
    73     explicit DqPtrs(
const std::set<const T *> &ts);
    80     inline bool empty(
void)
 const    81       { 
return lst_ptr::empty(); }
    82     inline iterator begin(
void)
    83       { 
return lst_ptr::begin(); }
    84     const_iterator begin(
void)
 const    85       { 
return lst_ptr::begin(); }
    87       { 
return lst_ptr::end(); }
    88     const_iterator end(
void)
 const    89       { 
return lst_ptr::end(); }
    90     inline indIterator indBegin(
void)
    91       { 
return indIterator(lst_ptr::begin()); }
    92     inline indIterator indEnd(
void)
    93       { 
return indIterator(lst_ptr::end()); }
    94     const T &
get(
const size_t &i) 
const;
    97     inline size_type size(
void)
 const    98       { 
return lst_ptr::size(); }
    99     bool in(
const T *) 
const;
   107     template <
class InputIterator>
   108     void insert(iterator pos, InputIterator f, InputIterator l)
   109       { lst_ptr::insert(pos,f,l); }
   110     template <
class InputIterator>
   111     void insert_unique(iterator pos, InputIterator f, InputIterator l)
   115     for(InputIterator i= f;i!=l;i++)
   119           { tmp.push_back(ptr); }
   121     lst_ptr::insert(pos,tmp.begin(),tmp.end()); 
   152     typename std::set<const T *>::const_iterator k;
   154     for(;k!=st.end();k++)
   155       lst_ptr::push_back(const_cast<T *>(*k));
   163     lst_ptr::operator=(other);
   181     for( const_iterator i= other.begin();i!=other.end();i++)
   190     boost::python::list retval;
   191     for(iterator i= begin();i!=end();i++)
   192       retval.append(boost::ref(*i));
   199   { lst_ptr::clear(); }
   213     const T *ptr= lst_ptr::at(i);
   222     for(const_iterator i= begin();i!= end();i++)
   236     for(const_iterator i= begin();i!= end();i++)
   252         if(find(begin(),end(),t) == end()) 
   254             lst_ptr::push_back(t);
   259       std::cerr << getClassName() << 
"::" << __FUNCTION__
   260             << 
"; attempt to insert a null pointer." << std::endl;
   270         if(find(begin(),end(),t) == end()) 
   272             lst_ptr::push_front(t);
   277       std::cerr << getClassName() << 
"::" << __FUNCTION__
   278             << 
"; attempt to insert a null pointer." << std::endl;
   287     const int sz= size();
   293         for(const_iterator i= begin();i!=end();i++)
   295             retval(loc)= (*i)->getTag();
   306     for(const_iterator i= this->begin();i!=this->end();i++)
   307       if(static_cast<size_t>((*i)->getTag())==tag) 
return *i;
   316     const int sz= size();
   320         const ID &tags= getTags();
   324       std::cerr << 
"DqPtrs<T>::sendDbTags - failed to send the IDs.\n";
   341       std::cerr << 
"DqPtrs<T>::receiveTags - failed to receive the IDs.\n";
 int sendInt(const int &, DbTagData &, const CommMetaData &)
Sends the integer through the communicator argument. 
Definition: Communicator.cc:875
DqPtrs & operator=(const DqPtrs &)
Assignment operator. 
Definition: DqPtrs.h:160
boost::python::list getPythonList(void)
Return a python list containing the pointers to the objects in this container. 
Definition: DqPtrs.h:188
Communication parameters between processes. 
Definition: Communicator.h:66
T * findTag(const size_t &)
Returns a pointer to the object identified by the tag argument. 
Definition: DqPtrs.h:304
int receiveInt(int &, DbTagData &, const CommMetaData &) const
Receives the integers through the communicator argument. 
Definition: Communicator.cc:935
int resize(const int &newSize, const int &fill_value=0)
Changes the size of the array. 
Definition: ID.cpp:187
EntityWithOwner & operator=(const EntityWithOwner &)
Assignment operator. 
Definition: EntityWithOwner.cc:53
Vector that stores the dbTags of the class members. 
Definition: DbTagData.h:44
Vector of integers. 
Definition: ID.h:95
DqPtrs(CommandEntity *owr=nullptr)
Constructor. 
Definition: DqPtrs.h:132
DqPtrs & operator+=(const DqPtrs &)
+= (union) operator. 
Definition: DqPtrs.h:169
const ID & getTags(void) const
Returns the tags of the objects. 
Definition: DqPtrs.h:284
Objet that can execute python scripts. 
Definition: CommandEntity.h:40
void clearAll(void)
Clears out the list of pointers and erases the properties of the object (if any). ...
Definition: DqPtrs.h:203
int sendID(const ID &, const int &)
Sends vector. 
Definition: Communicator.cc:73
const ID & receiveTags(int posSz, int pDbTg, DbTagData &dt, const Communicator &comm)
Sends the dbTags of the sets through the communicator argument. 
Definition: DqPtrs.h:330
Open source finite element program for structural analysis. 
Definition: ContinuaReprComponent.h:35
int sendTags(int posSz, int posDbTag, DbTagData &dt, Communicator &comm)
Sends the dbTags of the sets trough the communicator argument. 
Definition: DqPtrs.h:314
void clear(void)
Clears out the list of pointers. 
Definition: DqPtrs.h:198
int receiveID(ID &v, const int &) const
Receives el vector. 
Definition: Communicator.cc:80
void clearPyProps(void)
Clear python properties map. 
Definition: EntityWithProperties.cc:33
Pointer to (nodes, elements, points, lines,...) container. 
Definition: DqPtrs.h:57
bool in(const T *) const
Returns true if the pointer is in the container. 
Definition: DqPtrs.h:219
void extend(const DqPtrs &)
Extend this container with the pointers from the container being passed as parameter. 
Definition: DqPtrs.h:179