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

Public Member Functions

DriveCallerRead (const DataManager *pDM, MBDynParser &HP, bool bDeferred)
 
- Public Member Functions inherited from DriveCallerRead
virtual ~DriveCallerRead (void)
 

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 2841 of file drive_.cc.

Member Function Documentation

DriveCaller * FileDCR::Read ( const DataManager pDM,
MBDynParser HP,
bool  bDeferred 
)
virtual

Implements DriveCallerRead.

Definition at line 2847 of file drive_.cc.

References Drive::FILEDRIVE, fileDriveCallerTypeMap, fileDriveCallerTypeWordSet, HighParser::GetInt(), IncludeParser::GetLineData(), HighParser::GetReal(), FileDrive::iGetNumDrives(), HighParser::IsArg(), HighParser::IsKeyWord(), HighParser::IsWord(), MBDYN_EXCEPT_ARGS, DriveCallerRead::NeedDM(), DataManager::pFindDrive(), DataManager::pGetDrvHdl(), and SAFENEWWITHCONSTRUCTOR.

2848 {
2849  NeedDM(pDM, HP, bDeferred, "file");
2850 
2851  /* driver legato ai driver */
2852  if (pDM == 0) {
2853  silent_cerr("sorry, since the driver is not owned by a DataManager" << std::endl
2854  << "no driver dependent drivers are allowed;" << std::endl
2855  << "aborting..." << std::endl);
2857  }
2858 
2859  const DriveHandler* pDrvHdl = pDM->pGetDrvHdl();
2860  DriveCaller *pDC = 0;
2861 
2862  /* drive file */
2863  /* lettura dei dati specifici */
2864  unsigned int uL = HP.GetInt();
2865  FileDrive* pDrv = dynamic_cast<FileDrive*>(pDM->pFindDrive(Drive::FILEDRIVE, uL));
2866  if (pDrv == 0) {
2867  silent_cerr("line " << HP.GetLineData()
2868  << ": can't find FileDrive(" << uL << ")" << std::endl);
2870  }
2871 
2872  integer id = 1;
2873 
2874  const char *s = HP.IsWord(fileDriveCallerTypeWordSet);
2875  if (s != NULL) {
2876  FileDriveCallerTypeMap::iterator it = fileDriveCallerTypeMap.find(std::string(s));
2877  id = it->second->Read(pDM, HP, pDrv);
2878  } else {
2879  if (HP.IsArg()) {
2880  id = HP.GetInt(id);
2881  if (id < 1 || id > pDrv->iGetNumDrives()) {
2882  silent_cerr("line " << HP.GetLineData()
2883  << ": invalid column number " << id
2884  << " (must be between 1 and "
2885  << pDrv->iGetNumDrives() << ")" << std::endl);
2887  }
2888  }
2889  }
2890 
2891  doublereal da = 1.;
2892  if (HP.IsKeyWord("amplitude")) {
2893  da = HP.GetReal();
2894  }
2895 
2896  /* allocazione e creazione */
2899  FileDriveCaller(pDrvHdl, pDrv, id, da));
2900 
2901  return pDC;
2902 }
Drive * pFindDrive(Drive::Type Typ, unsigned int uL) const
Definition: elman.cc:705
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
virtual const char * IsWord(const HighParser::WordSet &ws)
Definition: parser.cc:977
FileDriveCallerTypeMap fileDriveCallerTypeMap
Definition: drive_.cc:2911
const DriveHandler * pGetDrvHdl(void) const
Definition: dataman.h:340
FileDriveCallerTypeWordSet fileDriveCallerTypeWordSet
Definition: drive_.cc:2912
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
virtual integer iGetNumDrives(void) const
Definition: filedrv.h:72
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
virtual bool IsArg(void)
Definition: parser.cc:807
void NeedDM(const DataManager *pDM, MBDynParser &HP, bool bDeferred, const char *const name)
Definition: drive_.cc:1354
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
virtual doublereal GetReal(const doublereal &dDefval=0.0)
Definition: parser.cc:1056

Here is the call graph for this function:


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