deps/PicklingTools170Release/Xm/ptools170/lib/ptools/t4val.cc
void sendT4Val (CPHEADER& hcb, const Val& v, string vrb_key, 
		Serialization_e ser)
{
	// Up front error checking.
  if (hcb.type != 4000) throw logic_error(hcb.file_name + " is not type 4000");
  if (!hcb.open) return;
  
  VRB vrb;
  (void)m_vrbinit(vrb, 0, hcb.vrecord_length);

  // Serialize using one of a few serializations: default was OC
  // But by allowing P0 and P2, Python primitives can read
  Array<char> buff;
  DumpValToArray(v, buff, ser);
  int sz    = buff.length();
  char* buf = buff.data(); 
	
  //int_4 pval =
  (void)m_vrbput(vrb, vrb_key, buf, sz, 0, 'B');
  m_filad(hcb, &vrb, 1);
  
  m_vrbfree(vrb, 0);
}
///////////////////////////////////////////////////////////////////////////////
// FUNCTION: sendT4Val
//
// DECRIPTION:
//   This function sends a Val through an already open T4000 file/pipe.
//   This is done by using a VRBSTRUCT simply as a pointer to an external
//   buffer which is then sent down the pipe.  The receiving end must know
//   that what it receives is not a normal VRBSTRUCT and handle the buffer
//   appropriately.  In this case the buffer contains a serialized Val
//   object, so the receiver must deserialize it to gain access to the Val.
//   recvT4Val was written for this purpose.
//
// NOTES:
//   In order to use these functions properly, initT4Val should be used
//   initialize the file/pipe and sendT4Val and recvT4Val should be used to
//   add and grab data to or from the file/pipe.
//
///////////////////////////////////////////////////////////////////////////////
sendT4Val
DECRIPTION:
This function sends a Val through an already open T4000 file/pipe.
This is done by using a VRBSTRUCT simply as a pointer to an external
buffer which is then sent down the pipe.  The receiving end must know
that what it receives is not a normal VRBSTRUCT and handle the buffer
appropriately.  In this case the buffer contains a serialized Val
object, so the receiver must deserialize it to gain access to the Val.
recvT4Val was written for this purpose.

In order to use these functions properly, initT4Val should be used
initialize the file/pipe and sendT4Val and recvT4Val should be used to
add and grab data to or from the file/pipe.
sendT4Val DECRIPTION : This function sends a Val through an already open T4000 file / pipe . This is done by using a VRBSTRUCT simply as a pointer to an external buffer which is then sent down the pipe . The receiving end must know that what it receives is not a normal VRBSTRUCT and handle the buffer appropriately . In this case the buffer contains a serialized Val object so the receiver must deserialize it to gain access to the Val . recvT4Val was written for this purpose . In order to use these functions properly initT4Val should be used initialize the file / pipe and sendT4Val and recvT4Val should be used to add and grab data to or from the file / pipe .
void sendT4Val (CPHEADER& hcb, const Val& v, string vrb_key, 
		Serialization_e ser)
{
  if (hcb.type != 4000) throw logic_error(hcb.file_name + " is not type 4000");
  if (!hcb.open) return;
  VRB vrb;
  (void)m_vrbinit(vrb, 0, hcb.vrecord_length);
  Array<char> buff;
  DumpValToArray(v, buff, ser);
  int sz    = buff.length();
  char* buf = buff.data(); 
  (void)m_vrbput(vrb, vrb_key, buf, sz, 0, 'B');
  m_filad(hcb, &vrb, 1);
  m_vrbfree(vrb, 0);
}
void sendT4Val ( CPHEADER & hcb , const Val & v , string vrb_key , Serialization_e ser ) { if ( hcb . type != 4000 ) throw logic_error ( hcb . file_name + " " ) ; if ( ! hcb . open ) return ; VRB vrb ; ( void ) m_vrbinit ( vrb , 0 , hcb . vrecord_length ) ; Array < char > buff ; DumpValToArray ( v , buff , ser ) ; int sz = buff . length ( ) ; char * buf = buff . data ( ) ; ( void ) m_vrbput ( vrb , vrb_key , buf , sz , 0 , ' ' ) ; m_filad ( hcb , & vrb , 1 ) ; m_vrbfree ( vrb , 0 ) ; }
FUNCTION: sendT4Val
DECRIPTION:
This function sends a Val through an already open T4000 file/pipe.
FUNCTION : sendT4Val DECRIPTION : This function sends a Val through an already open T4000 file / pipe .
// Up front error checking. // Serialize using one of a few serializations: default was OC // But by allowing P0 and P2, Python primitives can read //int_4 pval =