MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
hint_impl.h File Reference
#include <sstream>
#include "dataman.h"
#include "tpldrive_impl.h"
Include dependency graph for hint_impl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ParsableHint
 
class  DriveHint
 
class  TplVecHint< T >
 
class  TplDriveHint< T >
 

Typedefs

typedef TplVecHint< Vec3TplVecHint3
 
typedef TplVecHint< Vec6TplVecHint6
 
typedef TplDriveHint< Vec3TplDriveHint3
 
typedef TplDriveHint< Vec6TplDriveHint6
 

Functions

HintParseHint (DataManager *pDM, const char *s)
 

Typedef Documentation

Definition at line 136 of file hint_impl.h.

Definition at line 137 of file hint_impl.h.

Definition at line 98 of file hint_impl.h.

Definition at line 99 of file hint_impl.h.

Function Documentation

Hint* ParseHint ( DataManager pDM,
const char *  s 
)

Definition at line 37 of file hint_impl.cc.

References STRLENOF.

Referenced by SimulationEntity::ParseHint().

38 {
39  if (strncasecmp(s, "drive{", STRLENOF("drive{")) == 0) {
40  s += STRLENOF("drive{");
41 
42  size_t len = strlen(s);
43 
44  if (s[len - 1] != '}') {
45  return 0;
46  }
47 
48  char *sDriveStr = new char[len + 1];
49  memcpy(sDriveStr, s, len + 1);
50  sDriveStr[len - 1] = ';';
51 
52  return new DriveHint(sDriveStr);
53 
54  } else if (strncasecmp(s, "drive3{", STRLENOF("drive3{")) == 0) {
55  s += STRLENOF("drive3{");
56 
57  size_t len = strlen(s);
58 
59  if (s[len - 1] != '}') {
60  return 0;
61  }
62 
63  char *sDriveStr = new char[len + 1];
64  memcpy(sDriveStr, s, len + 1);
65  sDriveStr[len - 1] = ';';
66 
67  return new TplDriveHint<Vec3>(sDriveStr);
68 
69  } else if (strncasecmp(s, "drive6{", STRLENOF("drive6{")) == 0) {
70  s += STRLENOF("drive6{");
71 
72  size_t len = strlen(s);
73 
74  if (s[len - 1] != '}') {
75  return 0;
76  }
77 
78  char *sDriveStr = new char[len + 1];
79  memcpy(sDriveStr, s, len + 1);
80  sDriveStr[len - 1] = ';';
81 
82  return new TplDriveHint<Vec6>(sDriveStr);
83  }
84 
85  return 0;
86 }
#define STRLENOF(s)
Definition: mbdyn.h:166