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

Protected Member Functions

DriveCallerRead (const DataManager *pDM, MBDynParser &HP, const SimulationEntity *pSE, const std::string &msg)
 
- Protected Member Functions inherited from DriveCallerRead
void NeedDM (const DataManager *pDM, MBDynParser &HP, bool bDeferred, const char *const name)
 

Additional Inherited Members

- Public Member Functions inherited from DriveCallerRead
virtual ~DriveCallerRead (void)
 
virtual DriveCallerRead (const DataManager *pDM, MBDynParser &HP, bool bDeferred)=0
 
- Static Public Member Functions inherited from DriveCallerRead
static void ReadOutput (DriveCaller *pDC, const DataManager *pDM, MBDynParser &HP)
 

Detailed Description

Definition at line 2586 of file drive_.cc.

Member Function Documentation

DriveCaller * SimulationEntityDCR::Read ( const DataManager pDM,
MBDynParser HP,
const SimulationEntity pSE,
const std::string &  msg 
)
protected

Definition at line 2594 of file drive_.cc.

References MBDynParser::GetDriveCaller(), HighParser::GetInt(), IncludeParser::GetLineData(), HighParser::GetStringWithDelims(), SimulationEntity::iGetNumPrivData(), SimulationEntity::iGetPrivDataIdx(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, DataManager::pGetDrvHdl(), and SAFENEWWITHCONSTRUCTOR.

Referenced by ElementDCR::Read(), and NodeDCR::Read().

2596 {
2597  const DriveHandler* pDrvHdl = pDM->pGetDrvHdl();
2598  DriveCaller *pDC = 0;
2599 
2600  unsigned int iIndex = 0;
2601  std::string sIndexName;
2602  if (HP.IsKeyWord("string")) {
2603  sIndexName = HP.GetStringWithDelims();
2604  if (sIndexName.empty()) {
2605  silent_cerr("empty string for " << msg
2606  << " at line " << HP.GetLineData()
2607  << std::endl);
2609  }
2610  iIndex = pSE->iGetPrivDataIdx(sIndexName.c_str());
2611  if (iIndex == 0) {
2612  silent_cerr("illegal string \"" << sIndexName << "\""
2613  " for " << msg
2614  << " at line " << HP.GetLineData()
2615  << std::endl);
2617  }
2618 
2619  } else if (HP.IsKeyWord("index")) {
2620  silent_cout("\"index\" deprecated for " << msg
2621  << "; use \"string\" instead at line " << HP.GetLineData() << std::endl);
2622 
2623  iIndex = HP.GetInt();
2624 
2625  } else if (pSE->iGetNumPrivData() == 1) {
2626  iIndex = 1;
2627 
2628  } else {
2629  silent_cerr("need a private data index for " << msg
2630  << " at line " << HP.GetLineData() << std::endl);
2632  }
2633 
2634  if (iIndex < 1 || iIndex > pSE->iGetNumPrivData()) {
2635  silent_cerr("illegal index " << iIndex << " for " << msg
2636  << " at line " << HP.GetLineData() << std::endl);
2638  }
2639 
2640 #ifdef USE_MPI
2641  /* FIXME: todo ... */
2642  if (MPI::Is_initialized() && MBDynComm.Get_size() > 1) {
2643  silent_cerr("warning: add explicit connection entry for " << msg
2644  << " at line " << HP.GetLineData() << std::endl);
2645  }
2646 #endif /* USE_MPI */
2647 
2648  /* Chiamata ricorsiva a leggere il drive supplementare */
2649  DriveCaller* pTmp = 0;
2650  pTmp = HP.GetDriveCaller();
2651 
2652  /* allocazione e creazione */
2655  PrivDriveCaller(pDrvHdl, pTmp, pSE, iIndex, sIndexName.c_str()));
2656 
2657  return pDC;
2658 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual integer GetInt(integer iDefval=0)
Definition: parser.cc:1050
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: simentity.cc:142
const DriveHandler * pGetDrvHdl(void) const
Definition: dataman.h:340
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
virtual const char * GetStringWithDelims(enum Delims Del=DEFAULTDELIM, bool escape=true)
Definition: parser.cc:1228
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
virtual unsigned int iGetNumPrivData(void) const
Definition: simentity.cc:136
struct mbrtai_msg_t msg
DriveCaller * GetDriveCaller(bool bDeferred=false)
Definition: mbpar.cc:2033
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function:


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