当前位置: 首页>>代码示例>>C++>>正文


C++ MovableObject::recvSelf方法代码示例

本文整理汇总了C++中MovableObject::recvSelf方法的典型用法代码示例。如果您正苦于以下问题:C++ MovableObject::recvSelf方法的具体用法?C++ MovableObject::recvSelf怎么用?C++ MovableObject::recvSelf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MovableObject的用法示例。


在下文中一共展示了MovableObject::recvSelf方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

int 
UDP_Socket::recvObj(int commitTag,
    MovableObject &theObject, FEM_ObjectBroker &theBroker, 
    ChannelAddress *theAddress)
{
    int res = theObject.recvSelf(commitTag, *this, theBroker);
    if (res < 0) 
        return res;
    
    // check the address that message came from was correct
    if (theAddress != 0) {
        SocketAddress *theSocketAddress = 0;
        
        if (theAddress->getType() == SOCKET_TYPE) {
            theSocketAddress = (SocketAddress *)theAddress;
            
            if (memcmp((char *) &theSocketAddress->address.addr, (char *) &other_Addr.addr, 
                theSocketAddress->addrLength) != 0) {
                    opserr << "UDP_Socket::recvObj() - a UDP_Socket ";
                    opserr << "can only look at first incoming message\n"; 
                    opserr << "The last message did not come from write scource\n";
                    return -1;
            }
        }
        else {
            opserr << "UDP_Socket::recvObj() - a UDP_Socket ";
            opserr << "can only communicate with a UDP_Socket";
            opserr << " address given is not of type SocketAddress\n";
            return -1;
        }
    }
    
    return 0;
}
开发者ID:fmckenna,项目名称:OpenSees,代码行数:34,代码来源:UDP_Socket.cpp

示例2:

int 
TCP_Socket::recvObj(int commitTag,
    MovableObject &theObject, FEM_ObjectBroker &theBroker, 
    ChannelAddress *theAddress)
{
    // first check address is the only address a TCP_socket can send to
    SocketAddress *theSocketAddress = 0;
    if (theAddress != 0) {
        if (theAddress->getType() == SOCKET_TYPE) 
            theSocketAddress = (SocketAddress *)theAddress;
        else {
            opserr << "TCP_Socket::recvObj() - a TCP_Socket ";
            opserr << "can only communicate with a TCP_Socket";
            opserr << " address given is not of type SocketAddress\n"; 
            return -1;	    
        }		    
        if (bcmp((char *) &other_Addr.addr_in, (char *) &theSocketAddress->address.addr, 
            theSocketAddress->addrLength) != 0) {

                opserr << "TCP_Socket::recvObj() - a TCP_Socket ";
                opserr << "can only communicate with one other TCP_Socket\n"; 
                return -1;
        }
    }

    return theObject.recvSelf(commitTag, *this, theBroker);
}
开发者ID:DBorello,项目名称:OpenSees,代码行数:27,代码来源:TCP_Socket.cpp

示例3:

int 
FE_Datastore::recvObj(int commitTag,
		      MovableObject &theObject, 
		      FEM_ObjectBroker &theNewBroker,
		      ChannelAddress *theAddress)
{
  return theObject.recvSelf(commitTag, *this, theNewBroker);
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:8,代码来源:FE_Datastore.cpp

示例4: recvObj

int FileChannel::recvObj(int commitTag,
			MovableObject &theObject, 
			FEM_ObjectBroker &theBroker,
						  ChannelAddress *theAddress) {
  if ( !theFile )
	return -1;


  setCommitStep( commitTag );
  return theObject.recvSelf(commitTag, *this, theBroker);
}
开发者ID:DBorello,项目名称:OpenSees,代码行数:11,代码来源:FileChannel.cpp

示例5:

int 
MPI_Channel::recvObj(int commitTag,
		     MovableObject &theObject, 
		     FEM_ObjectBroker &theBroker, 
		     ChannelAddress *theAddress)
{
    // first check address is the only address a MPI_Channel can send to
    MPI_ChannelAddress *theMPI_ChannelAddress = 0;
    if (theAddress != 0) {
      if (theAddress->getType() == MPI_TYPE) {
	theMPI_ChannelAddress = (MPI_ChannelAddress *)theAddress;
	otherTag = theMPI_ChannelAddress->otherTag;
	otherComm= theMPI_ChannelAddress->otherComm;
      } else {
	opserr << "MPI_Channel::recvObj() - a MPI_Channel ";
	opserr << "can only communicate with a MPI_Channel";
	opserr << " address given is not of type MPI_ChannelAddress\n"; 
	return -1;	    
      }		    
    }
    return theObject.recvSelf(commitTag, *this, theBroker);
}
开发者ID:lge88,项目名称:OpenSees,代码行数:22,代码来源:MPI_Channel.cpp


注:本文中的MovableObject::recvSelf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。