Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
PModulePackage.cpp
Package: 视频会议系统.rar [view]
Upload User: popouu88
Upload Date: 2013-02-11
Package Size: 2894k
Code Size: 1k
Category:
VOIP program
Development Platform:
Visual C++
- // PModulePackage.cpp: implementation of the PModulePackage class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "PModulePackage.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- PModulePackage::PModulePackage()
- {
- this->Tag = PModulePackageTAG;
- this->module = 0;
- this->module_buffer = NULL;
- this->module_size = 0;
- }
- PModulePackage::~PModulePackage()
- {
- }
- bool PModulePackage::assembleData( int module , char * buffer , int size )
- {
- this->buffer.Resize( 4 * INT_SIZE + size );
- char * now = this->buffer.GetBuffer( );
- *( int * )now = this->buffer.GetSize( ); now += INT_SIZE;
- *( int * )now = this->Tag; now += INT_SIZE;
- *( int * )now = module; now += INT_SIZE;
- *( int * )now = size; now += INT_SIZE;
- if( size && buffer )
- memcpy( now , buffer , size );
- return true;
- }
- bool PModulePackage::parseData( CBuffer & buffer )
- {
- if( ! buffer.GetSize( ) ) return false;
- char * now = buffer.GetBuffer( ) + 2 * INT_SIZE;
- this->module = *( int * )now; now += INT_SIZE;
- this->module_size = *( int * )now; now += INT_SIZE;
- this->module_buffer = ! this->module_size ? NULL : now;
- return true;
- }