MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
CompTplDriveCaller< T > Class Template Reference
Inheritance diagram for CompTplDriveCaller< T >:
Collaboration diagram for CompTplDriveCaller< T >:

Public Member Functions

 CompTplDriveCaller (std::vector< DriveCaller * > &dc)
 
 ~CompTplDriveCaller (void)
 
virtual TplDriveCaller< T > * pCopy (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual std::ostream & Restart_int (std::ostream &out) const
 
Get (const doublereal &dVar) const
 
Get (void) const
 
bool bIsDifferentiable (void) const
 
GetP (void) const
 
int getNDrives (void) const
 
- Public Member Functions inherited from TplDriveCaller< T >
virtual ~TplDriveCaller (void)
 
- Public Member Functions inherited from DriveOwner
 DriveOwner (const DriveCaller *pDC=0)
 
 DriveOwner (const DriveOwner &drive)
 
virtual ~DriveOwner (void)
 
void Set (const DriveCaller *pDC)
 
DriveCallerpGetDriveCaller (void) const
 
doublereal dGet (const doublereal &dVar) const
 
doublereal dGet (void) const
 
bool bIsDifferentiable (void) const
 
doublereal dGetP (const doublereal &dVar) const
 
doublereal dGetP (void) const
 

Protected Attributes

std::vector< DriveCaller * > m_dc
 
- Protected Attributes inherited from DriveOwner
DriveCallerpDriveCaller
 

Detailed Description

template<class T>
class CompTplDriveCaller< T >

Definition at line 102 of file tpldrive_impl.cc.

Constructor & Destructor Documentation

template<class T >
CompTplDriveCaller< T >::CompTplDriveCaller ( std::vector< DriveCaller * > &  dc)
inline

Definition at line 107 of file tpldrive_impl.cc.

References MBDYN_EXCEPT_ARGS.

108  : m_dc(dc)
109  {
110  if (typeid(T) == typeid(Vec3)) {
111  if (dc.size() != 3) {
113  }
114 
115  } else if (typeid(T) == typeid(Vec6)) {
116  if (dc.size() != 6) {
118  }
119 
120  } else {
122  }
123  };
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
Definition: matvec6.h:37
std::vector< DriveCaller * > m_dc
template<class T >
CompTplDriveCaller< T >::~CompTplDriveCaller ( void  )
inline

Definition at line 125 of file tpldrive_impl.cc.

References CompTplDriveCaller< T >::m_dc.

125  {
126  for (unsigned i = 0; i < m_dc.size(); i++) {
127  delete m_dc[i];
128  }
129  };
std::vector< DriveCaller * > m_dc

Member Function Documentation

template<class T >
bool CompTplDriveCaller< T >::bIsDifferentiable ( void  ) const
inlinevirtual

Reimplemented from TplDriveCaller< T >.

Definition at line 187 of file tpldrive_impl.cc.

References CompTplDriveCaller< T >::m_dc.

Referenced by CompTplDriveCaller< Mat3x3 >::bIsDifferentiable(), and CompTplDriveCaller< Mat6x6 >::bIsDifferentiable().

187  {
188  for (unsigned i = 0; i < m_dc.size(); i++) {
189  if (!m_dc[i]->bIsDifferentiable()) {
190  return false;
191  }
192  }
193 
194  return true;
195  };
bool bIsDifferentiable(void) const
std::vector< DriveCaller * > m_dc
template<class T >
T CompTplDriveCaller< T >::Get ( const doublereal dVar) const
inlinevirtual

Implements TplDriveCaller< T >.

Definition at line 166 of file tpldrive_impl.cc.

References CompTplDriveCaller< T >::m_dc.

166  {
167  T t;
168 
169  for (unsigned i = 0; i < m_dc.size(); i++) {
170  t(i + 1) = m_dc[i]->dGet(dVar);
171  }
172 
173  return t;
174  };
std::vector< DriveCaller * > m_dc
template<class T >
T CompTplDriveCaller< T >::Get ( void  ) const
inlinevirtual

Reimplemented from TplDriveCaller< T >.

Definition at line 176 of file tpldrive_impl.cc.

References CompTplDriveCaller< T >::m_dc.

176  {
177  T t;
178 
179  for (unsigned i = 0; i < m_dc.size(); i++) {
180  t(i + 1) = m_dc[i]->dGet();
181  }
182 
183  return t;
184  };
std::vector< DriveCaller * > m_dc
template<class T >
int CompTplDriveCaller< T >::getNDrives ( void  ) const
inlinevirtual

Implements TplDriveCaller< T >.

Definition at line 207 of file tpldrive_impl.cc.

References CompTplDriveCaller< T >::m_dc.

207  {
208  return m_dc.size();
209  };
std::vector< DriveCaller * > m_dc
template<class T >
T CompTplDriveCaller< T >::GetP ( void  ) const
inlinevirtual

Reimplemented from TplDriveCaller< T >.

Definition at line 197 of file tpldrive_impl.cc.

References CompTplDriveCaller< T >::m_dc.

197  {
198  T t;
199 
200  for (unsigned i = 0; i < m_dc.size(); i++) {
201  t(i + 1) = m_dc[i]->dGetP();
202  }
203 
204  return t;
205  };
std::vector< DriveCaller * > m_dc
template<class T >
virtual TplDriveCaller<T>* CompTplDriveCaller< T >::pCopy ( void  ) const
inlinevirtual

Implements TplDriveCaller< T >.

Definition at line 132 of file tpldrive_impl.cc.

References CompTplDriveCaller< T >::m_dc, and SAFENEWWITHCONSTRUCTOR.

132  {
133  typedef CompTplDriveCaller<T> dc;
134  TplDriveCaller<T>* pDC = 0;
135 
136  std::vector<DriveCaller *> tmpdc(m_dc.size());
137 
138  for (unsigned i = 0; i < m_dc.size(); i++) {
139  tmpdc[i] = m_dc[i]->pCopy();
140  }
141 
142  SAFENEWWITHCONSTRUCTOR(pDC, dc, dc(tmpdc));
143 
144  return pDC;
145  };
std::vector< DriveCaller * > m_dc
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
template<class T >
virtual std::ostream& CompTplDriveCaller< T >::Restart ( std::ostream &  out) const
inlinevirtual

Implements TplDriveCaller< T >.

Definition at line 148 of file tpldrive_impl.cc.

References CompTplDriveCaller< T >::m_dc.

148  {
149  out << "component";
150 
151  for (unsigned i = 0; i < m_dc.size(); i++) {
152  out << ", ", m_dc[i]->Restart(out);
153  }
154 
155  return out;
156  };
std::vector< DriveCaller * > m_dc
template<class T >
virtual std::ostream& CompTplDriveCaller< T >::Restart_int ( std::ostream &  out) const
inlinevirtual

Implements TplDriveCaller< T >.

Definition at line 158 of file tpldrive_impl.cc.

References CompTplDriveCaller< T >::m_dc.

158  {
159  for (unsigned i = 0; i < m_dc.size(); i++) {
160  out << ", ", m_dc[i]->Restart(out);
161  }
162 
163  return out;
164  };
std::vector< DriveCaller * > m_dc

Member Data Documentation


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