MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
DriveHandler::MyClosestNext Class Reference
Inheritance diagram for DriveHandler::MyClosestNext:
Collaboration diagram for DriveHandler::MyClosestNext:

Public Member Functions

 MyClosestNext (unsigned int uLabel, const DriveHandler *pDH, const DriveCaller *pIncrementDC, doublereal dStartTime)
 
virtual ~MyClosestNext (void)
 
bool bGetClosestNext (void) const
 
virtual void Set (void)
 
- 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
 

Protected Attributes

const DriveHandlerpDH
 
const DriveOwner Increment
 
bool bMustSetNext
 
doublereal dNext
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 

Detailed Description

Definition at line 227 of file drive.h.

Constructor & Destructor Documentation

DriveHandler::MyClosestNext::MyClosestNext ( unsigned int  uLabel,
const DriveHandler pDH,
const DriveCaller pIncrementDC,
doublereal  dStartTime 
)

Definition at line 425 of file drive.cc.

References NO_OP.

429 : WithLabel(uLabel), pDH(pDH), Increment(pIncrement), bMustSetNext(false), dNext(dStartTime)
430 {
431  NO_OP;
432 }
#define NO_OP
Definition: myassert.h:74
unsigned int uLabel
Definition: withlab.h:44
const DriveOwner Increment
Definition: drive.h:230
doublereal dStartTime
const DriveHandler * pDH
Definition: drive.h:229
WithLabel(unsigned int uL=0, const std::string &sN="")
Definition: withlab.cc:38
DriveHandler::MyClosestNext::~MyClosestNext ( void  )
virtual

Definition at line 434 of file drive.cc.

References NO_OP.

435 {
436  NO_OP;
437 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

bool DriveHandler::MyClosestNext::bGetClosestNext ( void  ) const
inline

Definition at line 347 of file drive.h.

348 {
349  return pDH->dGetTime() >= dNext;
350 }
doublereal dGetTime(void) const
Definition: drive.h:386
const DriveHandler * pDH
Definition: drive.h:229
void DriveHandler::MyClosestNext::Set ( void  )
inlinevirtual

Definition at line 354 of file drive.h.

355 {
356  if (bMustSetNext) {
357  do {
358  dNext += Increment.dGet();
359  } while (bGetClosestNext());
360 
361  bMustSetNext = false;
362 
363  } else if (bGetClosestNext()) {
364  bMustSetNext = true;
365  }
366 }
bool bGetClosestNext(void) const
Definition: drive.h:347
const DriveOwner Increment
Definition: drive.h:230
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664

Member Data Documentation

bool DriveHandler::MyClosestNext::bMustSetNext
protected

Definition at line 231 of file drive.h.

doublereal DriveHandler::MyClosestNext::dNext
protected

Definition at line 232 of file drive.h.

const DriveOwner DriveHandler::MyClosestNext::Increment
protected

Definition at line 230 of file drive.h.

const DriveHandler* DriveHandler::MyClosestNext::pDH
protected

Definition at line 229 of file drive.h.


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