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

Public Types

enum  Type { MMD_MIN, MMD_MAX }
 

Public Member Functions

const char * c_str (void) const
 
 MinMaxDriveDCR (enum Type type)
 
DriveCallerRead (const DataManager *pDM, MBDynParser &HP, bool bDeferred)
 
- Public Member Functions inherited from DriveCallerRead
virtual ~DriveCallerRead (void)
 

Public Attributes

enum MinMaxDriveDCR::Type eType
 

Additional Inherited Members

- Static Public Member Functions inherited from DriveCallerRead
static void ReadOutput (DriveCaller *pDC, const DataManager *pDM, MBDynParser &HP)
 
- Protected Member Functions inherited from DriveCallerRead
void NeedDM (const DataManager *pDM, MBDynParser &HP, bool bDeferred, const char *const name)
 

Detailed Description

Definition at line 99 of file module-minmaxdrive.cc.

Member Enumeration Documentation

Enumerator
MMD_MIN 
MMD_MAX 

Definition at line 100 of file module-minmaxdrive.cc.

100  {
101  MMD_MIN,
102  MMD_MAX
103  } eType;
enum MinMaxDriveDCR::Type eType

Constructor & Destructor Documentation

MinMaxDriveDCR::MinMaxDriveDCR ( enum Type  type)
explicit

Definition at line 289 of file module-minmaxdrive.cc.

References NO_OP.

290 : eType(type)
291 {
292  NO_OP;
293 }
#define NO_OP
Definition: myassert.h:74
enum MinMaxDriveDCR::Type eType

Member Function Documentation

const char * MinMaxDriveDCR::c_str ( void  ) const

Definition at line 296 of file module-minmaxdrive.cc.

References ASSERT, eType, MBDYN_EXCEPT_ARGS, MMD_MAX, and MMD_MIN.

297 {
298  switch (eType) {
299  case MMD_MIN:
300  return "min";
301  case MMD_MAX:
302  return "max";
303  }
304 
305  ASSERT(0);
307 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
enum MinMaxDriveDCR::Type eType
#define ASSERT(expression)
Definition: colamd.c:977
DriveCaller * MinMaxDriveDCR::Read ( const DataManager pDM,
MBDynParser HP,
bool  bDeferred 
)
virtual

Implements DriveCallerRead.

Definition at line 310 of file module-minmaxdrive.cc.

References ASSERT, eType, MBDynParser::GetDriveCaller(), HighParser::GetInt(), IncludeParser::GetLineData(), MBDYN_EXCEPT_ARGS, MMD_MAX, MMD_MIN, and SAFENEWWITHCONSTRUCTOR.

311 {
312  DriveCaller *pDC = 0;
313 
314  const integer iNumDrives = HP.GetInt();
315 
316  if (iNumDrives < 1) {
317  silent_cerr("at least one drive caller expected at line " << HP.GetLineData() << std::endl);
319  }
320 
321  std::vector<DriveOwner> drives;
322 
323  drives.reserve(iNumDrives);
324 
325  for (int i = 0; i < iNumDrives; ++i) {
326  drives[i].Set(HP.GetDriveCaller());
327  }
328 
329  switch (eType) {
330  case MMD_MIN:
333  MinDriveCaller(drives));
334  break;
335 
336  case MMD_MAX:
339  MaxDriveCaller(drives));
340  break;
341 
342  default:
343  ASSERT(0);
345  }
346 
347  return pDC;
348 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
enum MinMaxDriveDCR::Type eType
#define ASSERT(expression)
Definition: colamd.c:977
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
DriveCaller * GetDriveCaller(bool bDeferred=false)
Definition: mbpar.cc:2033
long int integer
Definition: colamd.c:51
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:

Member Data Documentation

enum MinMaxDriveDCR::Type MinMaxDriveDCR::eType

Referenced by c_str(), and Read().


The documentation for this struct was generated from the following file: