本文整理汇总了C++中FEM_ObjectBroker::getPtrNewStream方法的典型用法代码示例。如果您正苦于以下问题:C++ FEM_ObjectBroker::getPtrNewStream方法的具体用法?C++ FEM_ObjectBroker::getPtrNewStream怎么用?C++ FEM_ObjectBroker::getPtrNewStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FEM_ObjectBroker
的用法示例。
在下文中一共展示了FEM_ObjectBroker::getPtrNewStream方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: idData
int
EnvelopeNodeRecorder::recvSelf(int commitTag, Channel &theChannel,
FEM_ObjectBroker &theBroker)
{
addColumnInfo = 1;
if (theChannel.isDatastore() == 1) {
opserr << "EnvelopeNodeRecorder::sendSelf() - does not send data to a datastore\n";
return -1;
}
static ID idData(6);
if (theChannel.recvID(0, commitTag, idData) < 0) {
opserr << "EnvelopeNodeRecorder::recvSelf() - failed to send idData\n";
return -1;
}
int numDOFs = idData(0);
int numNodes = idData(1);
dataFlag = idData(3);
this->setTag(idData(5));
if (idData(4) == 1)
echoTimeFlag = true;
else
echoTimeFlag = false;
//
// get the DOF ID data
//
if (theDofs == 0 || theDofs->Size() != numDOFs) {
if (theDofs != 0)
delete theDofs;
if (numDOFs != 0) {
theDofs = new ID(numDOFs);
if (theDofs == 0 || theDofs->Size() != numDOFs) {
opserr << "EnvelopeNodeRecorder::recvSelf() - out of memory\n";
return -1;
}
}
}
if (theDofs != 0)
if (theChannel.recvID(0, commitTag, *theDofs) < 0) {
opserr << "EnvelopeNodeRecorder::recvSelf() - failed to recv dof data\n";
return -1;
}
//
// get the NODAL tag data
//
if (theNodalTags == 0 || theNodalTags->Size() != numNodes) {
if (theNodalTags != 0)
delete theNodalTags;
if (numNodes != 0) {
theNodalTags = new ID(numNodes);
if (theNodalTags == 0 || theNodalTags->Size() != numNodes) {
opserr << "EnvelopeNodeRecorder::recvSelf() - out of memory\n";
return -1;
}
}
}
if (theNodalTags != 0)
if (theChannel.recvID(0, commitTag, *theNodalTags) < 0) {
opserr << "EnvelopeNodeRecorder::recvSelf() - failed to recv dof data\n";
return -1;
}
static Vector data(2);
if (theChannel.recvVector(0, commitTag, data) < 0) {
opserr << "EnvelopeNodeRecorder::sendSelf() - failed to receive data\n";
return -1;
}
deltaT = data(0);
nextTimeStampToRecord = data(1);
if (theHandler != 0)
delete theHandler;
theHandler = theBroker.getPtrNewStream(idData(2));
if (theHandler == 0) {
opserr << "EnvelopeNodeRecorder::sendSelf() - failed to get a data output handler\n";
return -1;
}
if (theHandler->recvSelf(commitTag, theChannel, theBroker) < 0) {
opserr << "EnvelopeNodeRecorder::sendSelf() - failed to send the DataOutputHandler\n";
return -1;
}
return 0;
}
示例2: idData
//.........这里部分代码省略.........
eleID = new ID(eleSize);
if (eleID == 0) {
opserr << "ElementRecorder::recvSelf() - failed to recv idData\n";
return -1;
}
if (theChannel.recvID(0, commitTag, *eleID) < 0) {
opserr << "ElementRecorder::recvSelf() - failed to recv idData\n";
return -1;
}
}
//
// resize & recv the dof
//
if (numDOF != 0) {
dof = new ID(numDOF);
if (dof == 0) {
opserr << "ElementRecorder::recvSelf() - failed to create dof\n";
return -1;
}
if (theChannel.recvID(0, commitTag, *dof) < 0) {
opserr << "ElementRecorder::recvSelf() - failed to recv dof\n";
return -1;
}
}
//
// recv the single char array of element response args
//
if (msgLength == 0) {
opserr << "EnvelopeElementRecorder::recvSelf() - 0 sized string for responses\n";
return -1;
}
char *allResponseArgs = new char[msgLength];
if (allResponseArgs == 0) {
opserr << "EnvelopeElementRecorder::recvSelf() - out of memory\n";
return -1;
}
Message theMessage(allResponseArgs, msgLength);
if (theChannel.recvMsg(0, commitTag, theMessage) < 0) {
opserr << "EnvelopeElementRecorder::recvSelf() - failed to recv message\n";
return -1;
}
//
// now break this single array into many
//
responseArgs = new char *[numArgs];
if (responseArgs == 0) {
opserr << "EnvelopeElementRecorder::recvSelf() - out of memory\n";
return -1;
}
char *currentLoc = allResponseArgs;
for (int j=0; j<numArgs; j++) {
int argLength = strlen(currentLoc)+1;
responseArgs[j] = new char[argLength];
if (responseArgs[j] == 0) {
opserr << "EnvelopeElementRecorder::recvSelf() - out of memory\n";
return -1;
}
strcpy(responseArgs[j], currentLoc);
currentLoc += argLength;
}
//
// create a new handler object and invoke recvSelf() on it
//
if (theHandler != 0)
delete theHandler;
theHandler = theBroker.getPtrNewStream(idData(3));
if (theHandler == 0) {
opserr << "NodeRecorder::sendSelf() - failed to get a data output handler\n";
return -1;
}
if (theHandler->recvSelf(commitTag, theChannel, theBroker) < 0) {
opserr << "NodeRecorder::sendSelf() - failed to send the DataOutputHandler\n";
return -1;
}
//
// clean up & return success
//
delete [] allResponseArgs;
return 0;
}
示例3: idData
int
NodeRecorder::recvSelf(int commitTag, Channel &theChannel,
FEM_ObjectBroker &theBroker)
{
addColumnInfo = 1;
if (theChannel.isDatastore() == 1) {
opserr << "NodeRecorder::sendSelf() - does not send data to a datastore\n";
return -1;
}
static ID idData(8);
if (theChannel.recvID(0, commitTag, idData) < 0) {
opserr << "NodeRecorder::recvSelf() - failed to send idData\n";
return -1;
}
int numDOFs = idData(0);
int numNodes = idData(1);
this->setTag(idData(6));
if (idData(3) == 1)
echoTimeFlag = true;
else
echoTimeFlag = false;
dataFlag = idData(4);
sensitivity = idData(5);
//
// get the DOF ID data
//
if (theDofs == 0 || theDofs->Size() != numDOFs) {
if (theDofs != 0)
delete theDofs;
if (numDOFs != 0) {
theDofs = new ID(numDOFs);
if (theDofs == 0 || theDofs->Size() != numDOFs) {
opserr << "NodeRecorder::recvSelf() - out of memory\n";
return -1;
}
}
}
if (theDofs != 0)
if (theChannel.recvID(0, commitTag, *theDofs) < 0) {
opserr << "NodeRecorder::recvSelf() - failed to recv dof data\n";
return -1;
}
//
// get the NODAL tag data
//
if (theNodalTags == 0 || theNodalTags->Size() != numNodes) {
if (theNodalTags != 0)
delete theNodalTags;
if (numNodes != 0) {
theNodalTags = new ID(numNodes);
if (theNodalTags == 0 || theNodalTags->Size() != numNodes) {
opserr << "NodeRecorder::recvSelf() - out of memory\n";
return -1;
}
}
}
if (theNodalTags != 0)
if (theChannel.recvID(0, commitTag, *theNodalTags) < 0) {
opserr << "NodeRecorder::recvSelf() - failed to recv dof data\n";
return -1;
}
static Vector data(2);
if (theChannel.recvVector(0, commitTag, data) < 0) {
opserr << "NodeRecorder::sendSelf() - failed to receive data\n";
return -1;
}
deltaT = data(0);
nextTimeStampToRecord = data(1);
if (theOutputHandler != 0)
delete theOutputHandler;
theOutputHandler = theBroker.getPtrNewStream(idData(2));
if (theOutputHandler == 0) {
opserr << "NodeRecorder::sendSelf() - failed to get a data output handler\n";
return -1;
}
if (theOutputHandler->recvSelf(commitTag, theChannel, theBroker) < 0) {
opserr << "NodeRecorder::sendSelf() - failed to send the DataOutputHandler\n";
return -1;
}
if (idData[7] == 1) {
//.........这里部分代码省略.........