Time of Update: 2018-12-05
一.伺服器端server.cpp的實現,如下:#include <iostream>#include <boost/asio.hpp>#include <boost/bind.hpp>#include <boost/shared_ptr.hpp>using namespace boost;using namespace boost::asio;class server{private: io_service& ios; ip::
Time of Update: 2018-12-05
五.Filter類的定義:Filter.h:#include <string>#include "Trie.h"class Filter {private:static bool __initialized;static Trie __trie;static void load(const char* fileName, int startPos);static bool censor(std::string& source);public:static bool __LEG
Time of Update: 2018-12-05
一.執行個體1,如下:#include <iostream>#include <string>class Startable;class StartableProcess{public:StartableProcess(Startable& _startable):startable(_startable){std::cout<<"Construct StartableProcess"<<std::endl;}void
Time of Update: 2018-12-05
#include <istream>#include <iostream>#include <fstream>#define PACKETRECV_SIZE 20typedef char Int8;typedef unsigned char UInt8;typedef signed int Int32;typedef unsigned int UInt32;using namespace std;UInt8
Time of Update: 2018-12-05
一.BinaryReader.h的定義如下:#ifndef LINYANWENBINARYREADER_H_#define LINYANWENBINARYREADER_H_#include "Poco/TextConverter.h"#include "Poco/Foundation.h"#include <vector>#include <istream>namespace Linyanwen {class TextEncoding;class
Time of Update: 2018-12-05
寫在前面:本篇文字在前面幾篇的基礎上,做了很大部分深入的改動,但thrift/rpc的通訊原理是一樣的thrift-client的實現:一.thrift_pool類:1.TTransport類的建立,如下:shared_ptr<TTransport> ThriftPool::CreateConnection(const string ip, int port){ /*採用TCP Socket進行資料轉送*/ shared_ptr<TSocket>
Time of Update: 2018-12-05
前一篇文字已經把thrift-client相關的敘述了,這裡簡單把makefile檔案的編寫也附上1.makefile的編寫,如下:SRC = $(wildcard \ ./*.cpp \ ../gen-cpp/*.cpp \ )CC = g++RELFLAGS = -O2 -g THRIFTFLAGS = -DHAVE_NETINET_IN_H -DHAVE_INTTYPES_HCFLAGS = -I./ -I../gen-cpp/
Time of Update: 2018-12-05
一.Cumulus::BinaryReader.h的定義,如下:#pragma once#include "Cumulus.h"#include "Address.h"#include "LinyanwenBinaryReader.h"#include "Poco/Net/SocketAddress.h"namespace Cumulus {class BinaryReader : public Linyanwen::BinaryReader
Time of Update: 2018-12-05
相關結構的定義,見前一篇文字:http://blog.csdn.net/linyanwen99/article/details/8485475 一.updateVideoCache方法的實現,如下:void updateVideoCache( VideoPkt *spProto) { Poco::SharedPtr<VideoPkt> pProto(spProto); VideoUidMap::Iterator itr = VideoUidMap.find(pProto-
Time of Update: 2018-12-05
1.定義cache_limit,如下:enum CACHELIMIT { MAXSPEAKERS = 8,//表示連線物件的最大數 MAX_PKTS = 20 //表示每個連線物件緩衝包的最大數};2.視頻包的定義,如下:struct VideoPkt{ uint32_t _from; uint32_t _sid; uint32_t _seq; uint32_t _time_stamp; std::string& payload; static int
Time of Update: 2018-12-05
作者:yurunsun@gmail.com 新浪微博@孫雨潤 新浪部落格 CSDN部落格日期:2013年7月9日linux後台開發需要熟練掌握哪些技能呢?1. 記憶體流失cpu wait% ↑top: swap memory ↑kswap進程valgrid中malloc/free值調用mallinfo輸出當前所佔記憶體strace -p 2. 野指標valgrid中access invalid address3. 機器負載較高記憶體流失:top進程太多: vmstat 1io阻塞:vmstat
Time of Update: 2018-12-05
今天在提問裡問了幾個大牛一個問題,大牛們說得很深,我的資質有很淺,沒辦法,我只能自己琢磨了啊,下面是正題 //////////////////////////////////////////////////////////////////////////////////////////7C9211FF test byte ptr [esi+10h],10h 7C921203 je 7C92FEF6 7C921209 pop esi 7C92
Time of Update: 2018-12-05
文章目錄 OverviewTable of ContentsDownloads Building a DLL with Visual C++156 ratings | 4.34 out of 5http://zone.ni.com/devzone/cda/tut/p/id/3056 Print OverviewMicrosoft's Visual C++ (MSVC) integrated development environment (
Time of Update: 2018-12-05
struct lambda_t { static void callback(echo_t::out_t& msg_) { echo_t::in_t in; in.value = "XXX_echo_test_XXX"; singleton_t<msg_bus_t>::instance() .get_service_group("echo") ->get_service(1)->async_call(in,
Time of Update: 2018-12-05
在《Visual
Time of Update: 2018-12-05
c/c++ 中經常會遇到時間和字串互相轉化的情形用以下2個函數來轉就很方便了1、時間轉字串函數size_t strftime(char *strDest, size_t maxsize, const char *format, const struct tm *timeptr);2、字串轉時間函數char *strptime(const char *s, const char *format,struct tm *tm);#include <stdio.h> #include
Time of Update: 2018-12-05
xml檔案本質就是小型的資料庫,換個角度來說就是,你對資料庫有什麼操作你對xml檔案就應能實現什麼操作。一般而言,對資料庫的操作包括以下幾種:建立資料庫、查詢資料庫、修改資料庫和刪除資料庫。那麼對應xml檔案就是建立xml檔案、查詢xml檔案的指定節點的值,修改xml檔案中節點的值和刪除xml檔案中節點的值。首先我們認識一下xml檔案有哪幾種形式。下面我列出一些常用的xml檔案的形式:example1.xml:<?xml version="1.0"
Time of Update: 2018-12-05
http://blog.csdn.net/shencaifeixia1/article/details/8147117__bridge:不涉及對象所有關係改變__bridge_transfer:給予 ARC 所有權__bridge_retained:解除 ARC 所有權形式:(__bridge type)expression;(__bridge_retained CF_type)expression;(__bridge_transfer Objective-C
Time of Update: 2018-12-05
在《Visual C++ TinyXml快速入門(二)》介紹使用tinyxml庫擷取xml檔案聲明,查詢指定節點、刪除指定節點的做法。在本文中繼續介紹修改指定節點和增加節點的做法。修改節點其實和查詢指定節點的值有點類似,也分為兩個函數,一個實現修改文本。另一個負責修改屬性。/*!* /brief 修改指定節點的文本。** /param XmlFile xml檔案全路徑。* /param strNodeName 指定的節點名。* /param strText 重新設定的文本的值*
Time of Update: 2018-12-05
《Visual C++、LabVIEW、LabWindows/CVI與MATLAB介面技術》發行者:王華 發布時間:2005-12-1 14:03:00 內容摘要Visual C++、LabVIEW、LabWindows/CVI與MATLAB接 口 技 術 王 華 袁中凡(四川大學製造科學與工程學院,四川 成都610065)E-mail: wanghua-1125@163.com摘要:詳細闡述了當今最為流行的物件導向的可視化編程工具Visual