https://mooseframework.inl.gov
Classes | Functions
PenetrationLocator.h File Reference

Go to the source code of this file.

Classes

class  PenetrationLocator
 

Functions

template<>
void dataLoad (std::istream &stream, std::map< dof_id_type, PenetrationInfo *> &m, void *context)
 We have to have a specialization for this map because the PenetrationInfo objects MUST get deleted before the ones are loaded from a file or it's a memory leak. More...
 

Function Documentation

◆ dataLoad()

template<>
void dataLoad ( std::istream &  stream,
std::map< dof_id_type, PenetrationInfo *> &  m,
void context 
)
inline

We have to have a specialization for this map because the PenetrationInfo objects MUST get deleted before the ones are loaded from a file or it's a memory leak.

Definition at line 115 of file PenetrationLocator.h.

116 {
117  std::map<dof_id_type, PenetrationInfo *>::iterator it = m.begin();
118  std::map<dof_id_type, PenetrationInfo *>::iterator end = m.end();
119 
120  for (; it != end; ++it)
121  delete it->second;
122 
123  m.clear();
124 
125  // First read the size of the map
126  unsigned int size = 0;
127  stream.read((char *)&size, sizeof(size));
128 
129  for (unsigned int i = 0; i < size; i++)
130  {
131  dof_id_type key;
132  loadHelper(stream, key, context);
133  loadHelper(stream, m[key], context);
134  }
135 }
void loadHelper(std::istream &stream, P &data, void *context)
Scalar helper routine.
Definition: DataIO.h:985
uint8_t dof_id_type