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

#include <streamdrive.h>

Inheritance diagram for StreamDrive:
Collaboration diagram for StreamDrive:

Classes

class  Copy
 
class  Modifier
 

Public Member Functions

 StreamDrive (unsigned int uL, const DriveHandler *pDH, const std::string &sFileName, integer nd, const std::vector< doublereal > &v0, bool c, StreamDrive::Modifier *pmod)
 
virtual ~StreamDrive (void)
 
void SetModifier (const Modifier *p)
 
const StreamDrive::ModifierpGetModifier (void) const
 
- Public Member Functions inherited from FileDrive
 FileDrive (unsigned int uL, const DriveHandler *pDH, const std::string &s, integer nd, const std::vector< doublereal > &v0)
 
virtual ~FileDrive (void)
 
virtual Drive::Type GetDriveType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const =0
 
virtual integer iGetNumDrives (void) const
 
virtual doublereal dGet (const doublereal &t, int i=1) const
 
- Public Member Functions inherited from Drive
 Drive (unsigned int uL, const DriveHandler *pDH)
 
virtual ~Drive (void)
 
virtual void ServePending (const doublereal &t)=0
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 

Protected Attributes

int size
 
std::vector< char > buf
 
bool create
 
const ModifierpMod
 
- Protected Attributes inherited from FileDrive
std::string sFileName
 
integer iNumDrives
 
doublerealpdVal
 
- Protected Attributes inherited from Drive
const DriveHandlerpDrvHdl
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 

Additional Inherited Members

- Public Types inherited from Drive
enum  Type { UNKNOWN = -1, FILEDRIVE = 0, LASTDRIVETYPE }
 
enum  Bailout { BO_NONE = 0x0, BO_UPPER = 0x1, BO_LOWER = 0x2, BO_ANY = (BO_UPPER | BO_LOWER) }
 
- Static Protected Attributes inherited from Drive
static doublereal dReturnValue = 0.
 

Detailed Description

Definition at line 42 of file streamdrive.h.

Constructor & Destructor Documentation

StreamDrive::StreamDrive ( unsigned int  uL,
const DriveHandler pDH,
const std::string &  sFileName,
integer  nd,
const std::vector< doublereal > &  v0,
bool  c,
StreamDrive::Modifier pmod 
)

Definition at line 42 of file streamdrive.cc.

References ASSERT, buf, grad::Copy(), StreamDrive::Modifier::GetSize(), pMod, and size.

47 : FileDrive(uL, pDH, sFileName, nd, v0),
48 create(c),
49 pMod(pmod)
50 {
51  ASSERT(nd > 0);
52 
53  if (pMod == 0) {
54  pMod = new StreamDrive::Copy(nd);
55  }
56 
57  // initialize mailbox and so on
58  size = pMod->GetSize();
59  buf.resize(size);
60 }
std::vector< char > buf
Definition: streamdrive.h:65
std::string sFileName
Definition: filedrv.h:46
FileDrive(unsigned int uL, const DriveHandler *pDH, const std::string &s, integer nd, const std::vector< doublereal > &v0)
Definition: filedrv.cc:52
virtual size_t GetSize(void) const =0
void Copy(scalar_func_type &d1, const scalar_func_type &d2, LocalDofMap *)
Definition: gradient.h:2827
#define ASSERT(expression)
Definition: colamd.c:977
static std::stack< cleanup * > c
Definition: cleanup.cc:59
static const std::vector< doublereal > v0
Definition: fixedstep.cc:45
const Modifier * pMod
Definition: streamdrive.h:69

Here is the call graph for this function:

StreamDrive::~StreamDrive ( void  )
virtual

Definition at line 62 of file streamdrive.cc.

References pMod.

63 {
64  if (pMod) {
65  delete pMod;
66  }
67 }
const Modifier * pMod
Definition: streamdrive.h:69

Member Function Documentation

const StreamDrive::Modifier * StreamDrive::pGetModifier ( void  ) const

Definition at line 80 of file streamdrive.cc.

References pMod.

Referenced by FlightGearFileDriveCallerTypeReader::Read().

81 {
82  return pMod;
83 }
const Modifier * pMod
Definition: streamdrive.h:69
void StreamDrive::SetModifier ( const Modifier p)

Definition at line 70 of file streamdrive.cc.

References pMod.

71 {
72  // FIXME: what if is not 0?
73  if (pMod != 0) {
74  delete pMod;
75  }
76 
77  pMod = p;
78 }
const Modifier * pMod
Definition: streamdrive.h:69

Member Data Documentation

std::vector<char> StreamDrive::buf
protected

Definition at line 65 of file streamdrive.h.

Referenced by RTMBDynInDrive::ServePending(), and StreamDrive().

bool StreamDrive::create
protected

Definition at line 67 of file streamdrive.h.

Referenced by RTMBDynInDrive::RTMBDynInDrive().

const Modifier* StreamDrive::pMod
protected
int StreamDrive::size
protected

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