• 大小: 1.31MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-15
  • 语言: C/C++
  • 标签: C++  MQ4CPP  

资源简介

MQ4CPP (Message Queuing for C++) is an implementation of enterprise messaging system, aka "message-oriented middleware" (MOM). It lets C++ application threads communicate with one another through exchanging messages. A message is a request, report, and/or event that contains information needed to coordinate communication between different applications. It provides a level of abstraction, so you can separate the details about the destination system from the application code. MQ4CCP lets C++ applications that share a messaging system exchange messages, and simplifies application development by providing a standard interface for creating, sending, and receiving messages. It implements the following messaging paradigms: Direct/Indirect messaging (local), unsolicited messaging (remote), Request/Reply (remote), conversation (remote), and broadcast (local/remote).

资源截图

代码片段和文件信息

///////////////////////////////////////////////////////////////////////////////
// MQ4CPP - Message queuing for C++
// Copyright (C) 2004-2007  Riccardo Pompeo (Italy)
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not write to the Free Software
// Foundation Inc. 59 Temple Place Suite 330 Boston MA  02111-1307  USA
//
// WARNING: PacketCompression works using a cache mechanism to avoid to send 
// dictionary information and reducing the bandwidth needed. This mechanism works 
// only in a peer-to-peer transmition. If you plan to use multicast packets or 
// to have a single server with multiple client the cache mechanism doesn‘t work
// correctly because PacketCompression isn‘t able to determine the packet source.  
// In this case you should disable caching calling PacketCompression(false)
// WARNING: compression is a cpu-consuming process. Use only if you have a low 
// bandwidth connectivity with your peer.
//

#define SILENT
#include “Trace.h“
#include “Logger.h“
#include “Compression.h“
#include “MergeSort.h“
#include “Timer.h“
#include 
#define SYMBOLS 256

PacketCompression::PacketCompression(bool theUseCacheMechanism)
{
TRACE(“PacketCompression::PacketCompression - start“)
itsUseCacheMechanism=theUseCacheMechanism;
stream_length=0;
shift_count=0;
accumulator=0;
bit_count=0;
percent=0;
itsSendPeerReset=true;
reset();
TRACE(“PacketCompression::PacketCompression - end“)
}

PacketCompression::~PacketCompression()
{
TRACE(“PacketCompression::~PacketCompression - start“)

TRACE(“PacketCompression::~PacketCompression - end“)
}

void PacketCompression::reset()
{
TRACE(“PacketCompression::reset - start“)

itsDeflateCacheIndex=0;

for(unsigned cnt=0; cnt < 8; cnt++)
{
itsDeflateCacheSchema[cnt]=0;
itsInflateCacheSchema[cnt]=0;
itsDeflateCacheCheckBit[cnt]=0;
itsInflateCacheCheckBit[cnt]=0;
}

for(unsigned cnt=0; cnt < 8; cnt++)
for(unsigned cnt1=0; cnt1 < 128; cnt1++)
{
itsDeflateCacheDictionary[cnt][cnt1]=0;
itsInflateCacheDictionary[cnt][cnt1]=0;
}

TRACE(“PacketCompression::reset - end“)
}

void PacketCompression::evaluateDictionary(vector< pair >& occurrenceunsigned* evaluator)
{
TRACE(“PacketCompression::evaluateDictionary - start“)

evaluator[0]=(1+0)*8;
evaluator[1]=(1+2)*8;
evaluator[2]=(1+4)*8;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        621  2006-04-03 05:58  mq4cpp_v1.16\.cdtproject

     文件       3470  2006-04-03 05:58  mq4cpp_v1.16\.project

     文件       7629  2007-06-23 23:19  mq4cpp_v1.16\ChangeLog

     文件      14559  2007-01-14 15:41  mq4cpp_v1.16\Compression.cpp

     文件       3164  2007-01-14 15:41  mq4cpp_v1.16\Compression.h

     文件     503417  2006-04-03 05:58  mq4cpp_v1.16\docs\class_diagram.png

     文件     275929  2006-04-03 05:58  mq4cpp_v1.16\docs\class_diagram_1.png

     文件     119780  2006-04-25 21:02  mq4cpp_v1.16\docs\class_diagram_2.png

     文件     486397  2007-03-30 12:16  mq4cpp_v1.16\docs\mq4cpp.pdf

    ....SH.     11776  2007-03-09 19:18  mq4cpp_v1.16\docs\Thumbs.db

     文件       6498  2006-12-17 20:57  mq4cpp_v1.16\Encription.cpp

     文件       2309  2006-12-17 20:57  mq4cpp_v1.16\Encription.h

     文件      21327  2007-01-01 12:26  mq4cpp_v1.16\examples\benchmark.cpp

     文件       2654  2006-12-17 20:57  mq4cpp_v1.16\examples\compr.cpp

     文件       3392  2006-12-17 20:57  mq4cpp_v1.16\examples\example1.cpp

     文件       3949  2006-12-17 20:57  mq4cpp_v1.16\examples\example10.cpp

     文件       5220  2006-12-17 20:57  mq4cpp_v1.16\examples\example11.cpp

     文件       4172  2006-12-17 20:57  mq4cpp_v1.16\examples\example12.cpp

     文件       4620  2006-12-17 20:57  mq4cpp_v1.16\examples\example13.cpp

     文件       5868  2007-02-07 11:40  mq4cpp_v1.16\examples\example14.cpp

     文件       4220  2006-12-17 20:57  mq4cpp_v1.16\examples\example2.cpp

     文件       5034  2006-12-17 20:57  mq4cpp_v1.16\examples\example3.cpp

     文件       4196  2006-12-17 20:57  mq4cpp_v1.16\examples\example4.cpp

     文件       4690  2006-12-17 20:57  mq4cpp_v1.16\examples\example5.cpp

     文件       5509  2006-12-17 20:57  mq4cpp_v1.16\examples\example6.cpp

     文件       4934  2006-12-20 21:40  mq4cpp_v1.16\examples\example7.cpp

     文件       5808  2006-12-17 20:57  mq4cpp_v1.16\examples\example8.cpp

     文件       3835  2006-12-17 20:57  mq4cpp_v1.16\examples\example9.cpp

     文件       4866  2007-02-02 17:50  mq4cpp_v1.16\examples\mqftp.cpp

     文件      12562  2006-12-17 20:57  mq4cpp_v1.16\examples\peer.cpp

............此处省略56个文件信息

评论

共有 条评论