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

#include <streamoutelem.h>

Inheritance diagram for StreamContentValue:
Collaboration diagram for StreamContentValue:

Public Member Functions

 StreamContentValue (const std::vector< ScalarValue * > &v, StreamContent::Modifier *pMod)
 
virtual ~StreamContentValue (void)
 
void Prepare (void)
 
unsigned GetNumChannels (void) const
 
- Public Member Functions inherited from StreamContent
 StreamContent (size_t size, Modifier *pMod)
 
virtual ~StreamContent (void)
 
void * GetBuf (void) const
 
int GetSize (void) const
 
const void * GetOutBuf (void) const
 
int GetOutSize (void) const
 

Protected Attributes

std::vector< ScalarValue * > Values
 
- Protected Attributes inherited from StreamContent
std::vector< char > buf
 
Modifierm_pMod
 

Additional Inherited Members

- Public Types inherited from StreamContent
enum  Type { UNKNOWN = -1, VALUES = 0, MOTION = 1, LASTTYPE }
 

Detailed Description

Definition at line 149 of file streamoutelem.h.

Constructor & Destructor Documentation

StreamContentValue::StreamContentValue ( const std::vector< ScalarValue * > &  v,
StreamContent::Modifier pMod 
)

Definition at line 227 of file streamoutelem.cc.

References ASSERT, and Values.

229 : StreamContent(sizeof(doublereal)*v.size(), pMod), Values(v)
230 {
231  ASSERT(Values.size() > 0);
232 }
std::vector< ScalarValue * > Values
#define ASSERT(expression)
Definition: colamd.c:977
double doublereal
Definition: colamd.c:52
StreamContent(size_t size, Modifier *pMod)
StreamContentValue::~StreamContentValue ( void  )
virtual

Definition at line 234 of file streamoutelem.cc.

References Values.

235 {
236  for (std::vector<ScalarValue *>::iterator i = Values.begin();
237  i != Values.end(); ++i)
238  {
239  delete *i;
240  }
241 }
std::vector< ScalarValue * > Values

Member Function Documentation

unsigned StreamContentValue::GetNumChannels ( void  ) const
virtual

Implements StreamContent.

Definition at line 261 of file streamoutelem.cc.

References Values.

262 {
263  return Values.size();
264 }
std::vector< ScalarValue * > Values
void StreamContentValue::Prepare ( void  )
virtual

Implements StreamContent.

Definition at line 244 of file streamoutelem.cc.

References StreamContent::buf, StreamContent::m_pMod, StreamContent::Modifier::Modify(), and Values.

245 {
246  char *curbuf = &buf[0];
247  for (std::vector<ScalarValue *>::iterator i = Values.begin(); i != Values.end(); ++i) {
248  /* assign value somewhere into mailbox buffer */
249  doublereal v = (*i)->dGetValue();
250 
251  doublereal *dbuf = (doublereal *)curbuf;
252  dbuf[0] = v;
253 
254  curbuf += sizeof(doublereal);
255  }
256 
257  m_pMod->Modify();
258 }
std::vector< ScalarValue * > Values
virtual void Modify(void)=0
std::vector< char > buf
Modifier * m_pMod
double doublereal
Definition: colamd.c:52

Here is the call graph for this function:

Member Data Documentation

std::vector<ScalarValue *> StreamContentValue::Values
protected

Definition at line 151 of file streamoutelem.h.

Referenced by GetNumChannels(), Prepare(), StreamContentValue(), and ~StreamContentValue().


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