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

#include <drive_.h>

Inheritance diagram for StringDriveCaller:
Collaboration diagram for StringDriveCaller:

Public Member Functions

 StringDriveCaller (const DriveHandler *pDH, const std::string &sTmpStr)
 
 ~StringDriveCaller (void)
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual DriveCallerpCopy (void) const
 
doublereal dGet (const doublereal &dVar) const
 
doublereal dGet (void) const
 
- Public Member Functions inherited from DriveCaller
 DriveCaller (const DriveHandler *pDH)
 
virtual ~DriveCaller (void)
 
virtual bool bIsDifferentiable (void) const
 
virtual doublereal dGetP (const doublereal &dVar) const
 
virtual doublereal dGetP (void) const
 
virtual void SetDrvHdl (const DriveHandler *pDH)
 
virtual const DriveHandlerpGetDrvHdl (void) const
 
virtual void Output (OutputHandler &OH) const
 
virtual void Trace (OutputHandler &OH) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from Traceable
 Traceable (flag fTrace=0)
 
virtual ~Traceable (void)
 
virtual flag fToBeTraced (void) const
 
virtual void SetTraceFlag (flag f=TRACE)
 

Private Attributes

const std::string sEvalStr
 

Additional Inherited Members

- Public Types inherited from DriveCaller
enum  OutputFlags { OUTPUT_VALUE = OUTPUT_PRIVATE << 0, OUTPUT_DERIVATIVE = OUTPUT_PRIVATE << 1 }
 
enum  TraceFlags { TRACE_VALUE = TRACE_PRIVATE << 0, TRACE_DERIVATIVE = TRACE_PRIVATE << 1 }
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 
- Public Types inherited from Traceable
enum  { TRACE = 0x01U, TRACE_PUBLIC_MASK = 0x0FU, TRACE_PRIVATE = 0x10U, TRACE_PRIVATE_MASK = ~TRACE_PUBLIC_MASK }
 
- Protected Attributes inherited from DriveCaller
DriveHandlerpDrvHdl
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 

Detailed Description

Definition at line 60 of file drive_.h.

Constructor & Destructor Documentation

StringDriveCaller::StringDriveCaller ( const DriveHandler pDH,
const std::string &  sTmpStr 
)

Definition at line 111 of file drive_.cc.

References ASSERT, and sEvalStr.

Referenced by pCopy().

113 : DriveCaller(pDH), sEvalStr(sTmpStr)
114 {
115  ASSERT(!sEvalStr.empty());
116 }
const std::string sEvalStr
Definition: drive_.h:63
DriveCaller(const DriveHandler *pDH)
Definition: drive.cc:475
#define ASSERT(expression)
Definition: colamd.c:977
StringDriveCaller::~StringDriveCaller ( void  )

Definition at line 119 of file drive_.cc.

References NO_OP.

120 {
121  NO_OP;
122 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

doublereal StringDriveCaller::dGet ( const doublereal dVar) const
inlinevirtual

Implements DriveCaller.

Definition at line 105 of file drive_.h.

References dGet(), DriveCaller::pDrvHdl, and DriveHandler::SetVar().

106 {
108 
109  return dGet();
110 }
void SetVar(const doublereal &dVar)
Definition: drive.cc:349
DriveHandler * pDrvHdl
Definition: drive.h:444
doublereal dGet(void) const
Definition: drive_.h:113

Here is the call graph for this function:

doublereal StringDriveCaller::dGet ( void  ) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 113 of file drive_.h.

References DriveHandler::dGet(), DriveCaller::pDrvHdl, sEvalStr, and MBDynErrBase::what().

Referenced by dGet().

114 {
115 #ifdef USE_EE
116  doublereal val;
117  try {
118  val = m_expr->Get()->Eval().GetReal();
119  } catch (MBDynErrBase& e) {
120  silent_cerr("StringDriveCaller::dGet(): " << e.what() << std::endl);
121  throw e;
122  }
123 
124  return val;
125 #else // ! USE_EE
126  std::istringstream in(sEvalStr);
127  InputStream In(in);
128 
129  return DriveCaller::pDrvHdl->dGet(In);
130 #endif // ! USE_EE
131 }
const char * what(void) const
Definition: except.cc:54
const std::string sEvalStr
Definition: drive_.h:63
DriveHandler * pDrvHdl
Definition: drive.h:444
double doublereal
Definition: colamd.c:52
doublereal dGet(InputStream &InStr) const
Definition: drive.cc:358

Here is the call graph for this function:

DriveCaller * StringDriveCaller::pCopy ( void  ) const
virtual

Implements DriveCaller.

Definition at line 125 of file drive_.cc.

References DriveCaller::pDrvHdl, SAFENEWWITHCONSTRUCTOR, sEvalStr, and StringDriveCaller().

126 {
127  DriveCaller* pDC = 0;
131 
132  return pDC;
133 }
const std::string sEvalStr
Definition: drive_.h:63
DriveHandler * pDrvHdl
Definition: drive.h:444
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
StringDriveCaller(const DriveHandler *pDH, const std::string &sTmpStr)
Definition: drive_.cc:111

Here is the call graph for this function:

std::ostream & StringDriveCaller::Restart ( std::ostream &  out) const
virtual

Implements DriveCaller.

Definition at line 140 of file drive_.cc.

References sEvalStr.

141 {
142  return out << "string, \"" << sEvalStr << "\"";
143 }
const std::string sEvalStr
Definition: drive_.h:63

Member Data Documentation

const std::string StringDriveCaller::sEvalStr
private

Definition at line 63 of file drive_.h.

Referenced by dGet(), pCopy(), Restart(), and StringDriveCaller().


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