MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
scalarvalue.cc File Reference
#include "mbconfig.h"
#include "dataman.h"
#include "scalarvalue.h"
Include dependency graph for scalarvalue.cc:

Go to the source code of this file.

Functions

ScalarValueReadScalarValue (DataManager *pDM, MBDynParser &HP)
 
void ReadScalarValues (DataManager *pDM, MBDynParser &HP, std::vector< ScalarValue * > &Values)
 

Function Documentation

ScalarValue* ReadScalarValue ( DataManager pDM,
MBDynParser HP 
)

Definition at line 80 of file scalarvalue.cc.

References MBDynParser::GetDriveCaller(), IncludeParser::GetLineData(), HighParser::IsKeyWord(), and ReadScalarDof().

Referenced by ReadElectric(), FlightGearStreamOutputReader::ReadFlightGearScalarValues(), ReadGenel(), and ReadScalarValues().

81 {
82  ScalarValue *svp = 0;
83 
84  if (HP.IsKeyWord("drive")) {
85  svp = new ScalarDriveValue(HP.GetDriveCaller(false));
86 
87  } else {
88  if (!HP.IsKeyWord("node" "dof")) {
89  silent_cerr("Warning, missing keyword \"node dof\" "
90  "at line " << HP.GetLineData() << std::endl);
91  }
92 
93  svp = new ScalarDofValue(ReadScalarDof(pDM, HP, false, true));
94  }
95 
96  return svp;
97 }
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
DriveCaller * GetDriveCaller(bool bDeferred=false)
Definition: mbpar.cc:2033
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
ScalarDof ReadScalarDof(const DataManager *pDM, MBDynParser &HP, bool bDof, bool bOrder)
Definition: dataman3.cc:2423

Here is the call graph for this function:

void ReadScalarValues ( DataManager pDM,
MBDynParser HP,
std::vector< ScalarValue * > &  Values 
)

Definition at line 101 of file scalarvalue.cc.

References IncludeParser::GetLineData(), MBDYN_EXCEPT_ARGS, and ReadScalarValue().

Referenced by ValuesContentTypeReader::Read(), and ReadGenel().

103 {
104  unsigned nch = Values.size();
105  if (nch == 0) {
106  silent_cerr("Request to read an empty ScalarValue vector "
107  "at line " << HP.GetLineData() << std::endl);
109  }
110 
111  for (unsigned int i = 0; i < nch; i++) {
112  Values[i] = ReadScalarValue(pDM, HP);
113  }
114 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
ScalarValue * ReadScalarValue(DataManager *pDM, MBDynParser &HP)
Definition: scalarvalue.cc:80
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697

Here is the call graph for this function: