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

#include <privpgin.h>

Inheritance diagram for NodePrivPlugIn:
Collaboration diagram for NodePrivPlugIn:

Public Member Functions

 NodePrivPlugIn (MathParser &mp, DataManager *pDM)
 
virtual ~NodePrivPlugIn (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 62 of file privpgin.h.

Constructor & Destructor Documentation

NodePrivPlugIn::NodePrivPlugIn ( MathParser mp,
DataManager pDM 
)

Definition at line 170 of file privpgin.cc.

References NO_OP.

171 : PrivPlugIn(mp, pDM)
172 {
173  NO_OP;
174 }
PrivPlugIn(MathParser &mp, DataManager *pDM)
Definition: privpgin.cc:37
#define NO_OP
Definition: myassert.h:74
NodePrivPlugIn::~NodePrivPlugIn ( void  )
virtual

Definition at line 176 of file privpgin.cc.

References NO_OP.

177 {
178  NO_OP;
179 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

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

Implements PrivPlugIn.

Definition at line 220 of file privpgin.cc.

References WithLabel::GetLabel(), Node::GetNodeType(), MBDYN_EXCEPT_ARGS, PrivPlugIn::pSE, and psNodeNames.

221 {
222  Node *pNode = dynamic_cast<Node *>(pSE);
223  if (pNode == 0) {
225  }
226 
227  return out << psNodeNames[pNode->GetNodeType()]
228  << "(" << pNode->GetLabel() << ")";
229 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: node.h:67
const char * psNodeNames[]
Definition: enums.cc:372
virtual Node::Type GetNodeType(void) const =0
unsigned int GetLabel(void) const
Definition: withlab.cc:62
SimulationEntity * pSE
Definition: privpgin.h:42

Here is the call graph for this function:

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

Implements PrivPlugIn.

Definition at line 188 of file privpgin.cc.

References Node::LASTNODETYPE, MBDYN_EXCEPT_ARGS, PrivPlugIn::pDM, DataManager::pFindNode(), PrivPlugIn::pSE, psReadNodesNodes, SAFEDELETEARR, SAFESTRDUP, and str2nodetype().

189 {
190  unsigned int i;
191  char *s = 0;
192 
193  /* eat spaces */
194  SAFESTRDUP(s, ss);
195  for (i = 0; s[i]; i++) {
196  if (isspace(s[i])) {
197  memmove(&s[i], &s[i + 1], strlen(&s[i]));
198  }
199  }
200 
201  i = str2nodetype(s);
202 
203  SAFEDELETEARR(s);
204 
205  if (i == Node::LASTNODETYPE) {
206  silent_cerr("unknown node type '" << ss << "'" << std::endl);
208  }
209 
210  pSE = dynamic_cast<SimulationEntity *>(pDM->pFindNode(Node::Type(i), uLabel));
211  if (pSE == 0) {
212  silent_cerr("NodePrivPlugIn: "
213  << psReadNodesNodes[i] << "(" << uLabel << ") "
214  "not defined" << std::endl);
216  }
217 }
const char * psReadNodesNodes[]
Definition: enums.cc:398
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
Node::Type str2nodetype(const char *const s)
Definition: node.cc:94
Type
Definition: node.h:71
#define SAFESTRDUP(pnt, src)
Definition: mynewmem.h:707
DataManager * pDM
Definition: privpgin.h:45
Node * pFindNode(Node::Type Typ, unsigned int uNode) const
Definition: nodeman.cc:179
SimulationEntity * pSE
Definition: privpgin.h:42

Here is the call graph for this function:

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

Implements PrivPlugIn.

Definition at line 182 of file privpgin.cc.

183 {
184  return "node";
185 }

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