MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
VectorPX Class Reference

#include <px.h>

Inheritance diagram for VectorPX:
Collaboration diagram for VectorPX:

Public Member Functions

 VectorPX (int i, DriveCaller **p)
 
virtual ~VectorPX (void)
 
virtual void AddInput (doublereal *pd) const
 
- Public Member Functions inherited from PersistentExcitation
 PersistentExcitation (int i)
 
virtual ~PersistentExcitation (void)
 
virtual int iGetNumDrives (void) const
 

Protected Attributes

DriveOwner ** pvDrives
 
- Protected Attributes inherited from PersistentExcitation
int iNumDrives
 

Detailed Description

Definition at line 68 of file px.h.

Constructor & Destructor Documentation

VectorPX::VectorPX ( int  i,
DriveCaller **  p 
)

Definition at line 100 of file px.cc.

References ASSERT, PersistentExcitation::iNumDrives, pvDrives, SAFEDELETEARR, SAFENEWARR, and SAFENEWWITHCONSTRUCTOR.

101 : PersistentExcitation(i), pvDrives(NULL)
102 {
103 #ifdef DEBUG
104  ASSERT(iNumDrives > 0);
105  ASSERT(pp != NULL);
106  for (int i = iNumDrives; i-- > 0; ) {
107  ASSERT(pp[i] != NULL);
108  }
109 #endif // DEBUG
110 
112 
113  for (int i = iNumDrives; i-- > 0; ) {
114  pvDrives[i] = NULL;
116  }
117 
118  SAFEDELETEARR(pp);
119 }
int iNumDrives
Definition: px.h:39
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
DriveOwner ** pvDrives
Definition: px.h:70
PersistentExcitation(int i)
Definition: px.cc:39
#define ASSERT(expression)
Definition: colamd.c:977
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
#define SAFENEWARR(pnt, item, sz)
Definition: mynewmem.h:701
VectorPX::~VectorPX ( void  )
virtual

Definition at line 122 of file px.cc.

References PersistentExcitation::iNumDrives, pvDrives, SAFEDELETE, and SAFEDELETEARR.

123 {
124  for (int i = iNumDrives; i-- > 0; ) {
125  SAFEDELETE(pvDrives[i]);
126  }
128 }
int iNumDrives
Definition: px.h:39
#define SAFEDELETEARR(pnt)
Definition: mynewmem.h:713
DriveOwner ** pvDrives
Definition: px.h:70
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710

Member Function Documentation

void VectorPX::AddInput ( doublereal pd) const
virtual

Implements PersistentExcitation.

Definition at line 131 of file px.cc.

References DriveOwner::dGet(), PersistentExcitation::iNumDrives, and pvDrives.

132 {
133  for (int i = iNumDrives; i-- > 0; ) {
134  pd[i] += pvDrives[i]->dGet();
135  }
136 }
int iNumDrives
Definition: px.h:39
DriveOwner ** pvDrives
Definition: px.h:70
doublereal dGet(const doublereal &dVar) const
Definition: drive.cc:664

Here is the call graph for this function:

Member Data Documentation

DriveOwner** VectorPX::pvDrives
protected

Definition at line 70 of file px.h.

Referenced by AddInput(), VectorPX(), and ~VectorPX().


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