MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
socketstream_out_elem.cc File Reference
#include "mbconfig.h"
#include <cstring>
#include "dataman.h"
#include "socketstream_out_elem.h"
#include "socketstreammotionelem.h"
#include "sock.h"
#include "geomdata.h"
Include dependency graph for socketstream_out_elem.cc:

Go to the source code of this file.

Classes

struct  SocketStreamOutputDataTmp
 
struct  SocketStreamOutputElemCreator
 

Functions

ElemReadSocketStreamElem (DataManager *pDM, MBDynParser &HP, unsigned int uLabel, StreamContent::Type type)
 
void WriteStreamContentLogOutput (const StreamContent *pSC, std::ostream &out)
 

Variables

static const int sock_stream = 1
 
static const int sock_dgram = 2
 

Function Documentation

Elem* ReadSocketStreamElem ( DataManager pDM,
MBDynParser HP,
unsigned int  uLabel,
StreamContent::Type  type 
)

Definition at line 240 of file socketstream_out_elem.cc.

References SocketStreamOutputElemCreator::createSocketStreamOutElem(), SocketStreamOutputElemCreator::getSocketStreamOutParam(), SocketStreamOutputDataTmp::pSC, SocketStreamOutputDataTmp::pSOE, ReadStreamContent(), and ReadStreamOutEcho().

Referenced by ReadOutputElem().

241 {
242  SocketStreamOutputDataTmp socketStreamOutputDataTmp;
243  SocketStreamOutputElemCreator socketStreamOutputElemCreator;
244  socketStreamOutputElemCreator.getSocketStreamOutParam(pDM, HP, uLabel, type, socketStreamOutputDataTmp);
245  socketStreamOutputDataTmp.pSOE = ReadStreamOutEcho(HP);
246  socketStreamOutputDataTmp.pSC = ReadStreamContent(pDM, HP, type);
247  Elem* pEl = socketStreamOutputElemCreator.createSocketStreamOutElem(pDM, HP, uLabel, type, socketStreamOutputDataTmp);
248  return pEl;
249 }
virtual Elem * createSocketStreamOutElem(DataManager *pDM, MBDynParser &HP, unsigned int uLabel, StreamContent::Type type, SocketStreamOutputDataTmp &socketStreamOutputDataTmp)
StreamContent * ReadStreamContent(DataManager *pDM, MBDynParser &HP, StreamContent::Type type)
StreamOutEcho * ReadStreamOutEcho(MBDynParser &HP)
virtual void getSocketStreamOutParam(DataManager *pDM, MBDynParser &HP, unsigned int uLabel, StreamContent::Type type, SocketStreamOutputDataTmp &socketStreamOutputDataTmp)
Definition: elem.h:75

Here is the call graph for this function:

void WriteStreamContentLogOutput ( const StreamContent pSC,
std::ostream &  out 
)

Definition at line 635 of file socketstream_out_elem.cc.

References StreamContent::GetNumChannels(), StreamContentMotion::nodes_begin(), StreamContentMotion::nodes_end(), GeometryData::R, GeometryData::RT, StreamContentMotion::uGetFlags(), GeometryData::V, GeometryData::W, and GeometryData::X.

Referenced by SocketStreamOutputElemCreator::createSocketStreamOutElem().

637 {
638  const StreamContentMotion* pSCM = NULL;
639  pSCM = dynamic_cast<const StreamContentMotion*>(pSC);
640 
641  if (pSCM == NULL)
642  {
643  // pSC is of type StreamContent::VALUES
644  out
645  << " values"
646  << " " << pSC->GetNumChannels()
647  << std::endl;
648  } else {
649  // pSC is of type StreamContent::MOTION
650  const unsigned uFlags = pSCM->uGetFlags();
651  out
652  << " motion"
653  << " " << bool(uFlags & GeometryData::X)
654  << " " << bool(uFlags & GeometryData::R)
655  << " " << bool(uFlags & GeometryData::RT)
656  << " " << bool(uFlags & GeometryData::V)
657  << " " << bool(uFlags & GeometryData::W);
658 
659  for (std::vector<const StructNode*>::const_iterator i = pSCM->nodes_begin();
660  i != pSCM->nodes_end(); ++i)
661  {
662  out << " " << (*i)->GetLabel();
663  }
664 
665  out << std::endl;
666  }
667 }
const unsigned uGetFlags(void) const
int bool
Definition: mbdyn.h:74
std::vector< const StructNode * >::const_iterator nodes_begin(void) const
virtual unsigned GetNumChannels(void) const =0
std::vector< const StructNode * >::const_iterator nodes_end(void) const

Here is the call graph for this function:

Variable Documentation

const int sock_dgram = 2
static
const int sock_stream = 1
static