MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
ElemPrivPlugIn Class Reference

#include <privpgin.h>

Inheritance diagram for ElemPrivPlugIn:
Collaboration diagram for ElemPrivPlugIn:

Public Member Functions

 ElemPrivPlugIn (MathParser &mp, DataManager *pDM)
 
virtual ~ElemPrivPlugIn (void)
 
const char * sName (void) const
 
- Public Member Functions inherited from PrivPlugIn
 PrivPlugIn (MathParser &mp, DataManager *pDM)
 
virtual ~PrivPlugIn (void)
 
int Read (int argc, char *argv[])
 
TypedValue::Type GetType (void) const
 
TypedValue GetVal (void) const
 
- Public Member Functions inherited from MathParser::PlugIn
 PlugIn (MathParser &mp)
 
virtual ~PlugIn ()
 

Protected Member Functions

virtual void ReadSE (unsigned int uLabel, const char *s)
 
virtual std::ostream & Err (std::ostream &out) const
 
- Protected Member Functions inherited from PrivPlugIn
unsigned int ReadLabel (const char *s)
 
void ReadIndex (unsigned int iMaxIndex, const char *s)
 

Additional Inherited Members

- Protected Attributes inherited from PrivPlugIn
SimulationEntitypSE
 
unsigned int iIndex
 
std::string sIndexName
 
DataManagerpDM
 
- Protected Attributes inherited from MathParser::PlugIn
MathParsermp
 

Detailed Description

Definition at line 73 of file privpgin.h.

Constructor & Destructor Documentation

ElemPrivPlugIn::ElemPrivPlugIn ( MathParser mp,
DataManager pDM 
)

Definition at line 231 of file privpgin.cc.

References NO_OP.

232 : PrivPlugIn(mp, pDM)
233 {
234  NO_OP;
235 }
PrivPlugIn(MathParser &mp, DataManager *pDM)
Definition: privpgin.cc:37
#define NO_OP
Definition: myassert.h:74
ElemPrivPlugIn::~ElemPrivPlugIn ( void  )
virtual

Definition at line 237 of file privpgin.cc.

References NO_OP.

238 {
239  NO_OP;
240 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

std::ostream & ElemPrivPlugIn::Err ( std::ostream &  out) const
protectedvirtual

Implements PrivPlugIn.

Definition at line 281 of file privpgin.cc.

References Elem::GetElemType(), WithLabel::GetLabel(), MBDYN_EXCEPT_ARGS, PrivPlugIn::pSE, and psElemNames.

282 {
283  Elem *pElem = dynamic_cast<Elem *>(pSE);
284  if (pElem == 0) {
286  }
287 
288  return out << psElemNames[pElem->GetElemType()]
289  << "(" << pElem->GetLabel() << ")";
290 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual Elem::Type GetElemType(void) const =0
Definition: elem.h:75
const char * psElemNames[]
Definition: enums.cc:39
unsigned int GetLabel(void) const
Definition: withlab.cc:62
SimulationEntity * pSE
Definition: privpgin.h:42

Here is the call graph for this function:

void ElemPrivPlugIn::ReadSE ( unsigned int  uLabel,
const char *  s 
)
protectedvirtual

Implements PrivPlugIn.

Definition at line 249 of file privpgin.cc.

References Elem::LASTELEMTYPE, MBDYN_EXCEPT_ARGS, PrivPlugIn::pDM, DataManager::pFindElem(), PrivPlugIn::pSE, psReadElemsElems, SAFEDELETEARR, SAFESTRDUP, and str2elemtype().

250 {
251  unsigned int i;
252  char *s = 0;
253 
254  /* eat spaces */
255  SAFESTRDUP(s, ss);
256  for (i = 0; s[i]; i++) {
257  if (isspace(s[i])) {
258  memmove(&s[i], &s[i + 1], strlen(&s[i]));
259  }
260  }
261 
262  i = str2elemtype(s);
263 
264  SAFEDELETEARR(s);
265 
266  if (i == Elem::LASTELEMTYPE) {
267  silent_cerr("unknown element type \"" << ss << "\"" << std::endl);
269  }
270 
271  pSE = dynamic_cast<SimulationEntity *>(pDM->pFindElem(Elem::Type(i), uLabel));
272  if (pSE == 0) {
273  silent_cerr("ElemPrivPlugIn: "
274  << psReadElemsElems[i] << "(" << uLabel << ") "
275  "not defined" << std::endl);
277  }
278 }
Elem::Type str2elemtype(const char *const s)
Definition: elem.cc:159
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
Elem * pFindElem(Elem::Type Typ, unsigned int uElem, unsigned int iDeriv) const
Definition: elman.cc:650
Type
Definition: elem.h:91
#define SAFESTRDUP(pnt, src)
Definition: mynewmem.h:707
const char * psReadElemsElems[]
Definition: enums.cc:79
DataManager * pDM
Definition: privpgin.h:45
SimulationEntity * pSE
Definition: privpgin.h:42

Here is the call graph for this function:

const char * ElemPrivPlugIn::sName ( void  ) const
virtual

Implements PrivPlugIn.

Definition at line 243 of file privpgin.cc.

244 {
245  return "element";
246 }

The documentation for this class was generated from the following files: