PSynCommand.cpp
资源名称:视频会议系统.rar [点击查看]
上传用户:popouu88
上传日期:2013-02-11
资源大小:2894k
文件大小:1k
源码类别:
IP电话/视频会议
开发平台:
Visual C++
- // PSynCommand.cpp: implementation of the PSynCommand class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "PSynCommand.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- PSynCommand::PSynCommand()
- {
- this->Tag = PSynCommandTAG;
- this->syncommand = 0;
- this->full_screen = false;
- }
- PSynCommand::~PSynCommand()
- {
- }
- bool PSynCommand::assembleData( int cmd , bool fullScreen )
- {
- this->buffer.Resize( 4 * INT_SIZE );
- char * now = this->buffer.GetBuffer( );
- *( int * )now = this->buffer.GetSize( ); now += INT_SIZE;
- *( int * )now = this->Tag; now += INT_SIZE;
- *( int * )now = cmd; now += INT_SIZE;
- *( int * )now = ( int )fullScreen;
- return true;
- }
- bool PSynCommand::parseData( CBuffer & buffer )
- {
- if( ! buffer.GetSize( ) ) return false;
- char * now = buffer.GetBuffer( ) + 2 * INT_SIZE;
- this->syncommand = *( int * )now; now += INT_SIZE;
- this->full_screen = ( bool ) * ( int * )now;
- return true;
- }