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

#include <drive_.h>

Inheritance diagram for DriveArrayCaller:
Collaboration diagram for DriveArrayCaller:

Public Types

typedef std::vector< const
DriveCaller * > 
dcv_t
 
- 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 }
 

Public Member Functions

 DriveArrayCaller (const DriveHandler *pDH, dcv_t &DC)
 
virtual ~DriveArrayCaller (void)
 
virtual DriveCallerpCopy (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
doublereal dGet (const doublereal &dVar) const
 
doublereal dGet (void) const
 
virtual bool bIsDifferentiable (void) const
 
virtual doublereal dGetP (const doublereal &dVar) const
 
- Public Member Functions inherited from DriveCaller
 DriveCaller (const DriveHandler *pDH)
 
virtual ~DriveCaller (void)
 
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

dcv_t m_dc
 

Additional Inherited Members

- 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 1489 of file drive_.h.

Member Typedef Documentation

Definition at line 1491 of file drive_.h.

Constructor & Destructor Documentation

DriveArrayCaller::DriveArrayCaller ( const DriveHandler pDH,
dcv_t DC 
)

Definition at line 1114 of file drive_.cc.

References ASSERT, and m_dc.

Referenced by pCopy().

1115 : DriveCaller(pDH), m_dc(DC)
1116 {
1117 #ifdef DEBUG
1118  ASSERT(!m_dc.empty());
1119  for (dcv_t::const_iterator i = m_dc.begin(); i != m_dc.end(); ++i) {
1120  ASSERT((*i) != 0);
1121  }
1122 #endif /* DEBUG */
1123 }
DriveCaller(const DriveHandler *pDH)
Definition: drive.cc:475
#define ASSERT(expression)
Definition: colamd.c:977
DriveArrayCaller::~DriveArrayCaller ( void  )
virtual

Definition at line 1125 of file drive_.cc.

References ASSERT, m_dc, and SAFEDELETE.

1126 {
1127  ASSERT(!m_dc.empty());
1128 
1129  for (dcv_t::iterator i = m_dc.begin(); i != m_dc.end(); ++i) {
1130  SAFEDELETE(*i);
1131  }
1132 }
#define ASSERT(expression)
Definition: colamd.c:977
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

bool DriveArrayCaller::bIsDifferentiable ( void  ) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 1546 of file drive_.h.

References ASSERT, and m_dc.

1547 {
1548  for (dcv_t::const_iterator i = m_dc.begin(); i != m_dc.end(); ++i) {
1549  ASSERT(*i != 0);
1550 
1551  if (!(*i)->bIsDifferentiable()) {
1552  return false;
1553  }
1554  }
1555 
1556  return true;
1557 }
#define ASSERT(expression)
Definition: colamd.c:977
doublereal DriveArrayCaller::dGet ( const doublereal dVar) const
inlinevirtual

Implements DriveCaller.

Definition at line 1518 of file drive_.h.

References ASSERT, and m_dc.

1519 {
1520  doublereal d = 0.;
1521 
1522  for (dcv_t::const_iterator i = m_dc.begin(); i != m_dc.end(); ++i) {
1523  ASSERT(*i != 0);
1524 
1525  d += (*i)->dGet(dVar);
1526  }
1527 
1528  return d;
1529 }
#define ASSERT(expression)
Definition: colamd.c:977
double doublereal
Definition: colamd.c:52
doublereal DriveArrayCaller::dGet ( void  ) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 1532 of file drive_.h.

References ASSERT, and m_dc.

1533 {
1534  doublereal d = 0.;
1535 
1536  for (dcv_t::const_iterator i = m_dc.begin(); i != m_dc.end(); ++i) {
1537  ASSERT(*i != 0);
1538 
1539  d += (*i)->dGet();
1540  }
1541 
1542  return d;
1543 }
#define ASSERT(expression)
Definition: colamd.c:977
double doublereal
Definition: colamd.c:52
doublereal DriveArrayCaller::dGetP ( const doublereal dVar) const
inlinevirtual

Reimplemented from DriveCaller.

Definition at line 1560 of file drive_.h.

References ASSERT, and m_dc.

1561 {
1562  doublereal dP = 0.;
1563 
1564  for (dcv_t::const_iterator i = m_dc.begin(); i != m_dc.end(); ++i) {
1565  ASSERT(*i != 0);
1566  ASSERT((*i)->bIsDifferentiable());
1567 
1568  dP += (*i)->dGetP(dVar);
1569  }
1570 
1571  return dP;
1572 }
#define ASSERT(expression)
Definition: colamd.c:977
double doublereal
Definition: colamd.c:52
DriveCaller * DriveArrayCaller::pCopy ( void  ) const
virtual

Implements DriveCaller.

Definition at line 1136 of file drive_.cc.

References ASSERT, DriveArrayCaller(), m_dc, DriveCaller::pDrvHdl, and SAFENEWWITHCONSTRUCTOR.

1137 {
1138  ASSERT(!m_dc.empty());
1139 
1140  dcv_t DC(m_dc.size());
1141 
1142  for (unsigned i = 0; i < m_dc.size(); i++) {
1143  DC[i] = m_dc[i]->pCopy();
1144  }
1145 
1146  DriveCaller* pDC = 0;
1149  DriveArrayCaller(pDrvHdl, DC));
1150 
1151  return pDC;
1152 }
DriveArrayCaller(const DriveHandler *pDH, dcv_t &DC)
Definition: drive_.cc:1114
std::vector< const DriveCaller * > dcv_t
Definition: drive_.h:1491
DriveHandler * pDrvHdl
Definition: drive.h:444
#define ASSERT(expression)
Definition: colamd.c:977
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698

Here is the call graph for this function:

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

Implements DriveCaller.

Definition at line 1156 of file drive_.cc.

References ASSERT, and m_dc.

1157 {
1158  out << " array, " << m_dc.size();
1159 
1160  for (dcv_t::const_iterator i = m_dc.begin(); i != m_dc.end(); ++i) {
1161  ASSERT((*i) != 0);
1162 
1163  out << ", ", (*i)->Restart(out);
1164  }
1165 
1166  return out;
1167 }
#define ASSERT(expression)
Definition: colamd.c:977

Member Data Documentation

dcv_t DriveArrayCaller::m_dc
private

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