锘??xml version="1.0" encoding="utf-8" standalone="yes"?>天堂久久天堂AV色综合,久久久www免费人成精品,久久性生大片免费观看性http://www.shnenglu.com/jinq0123/category/5137.htmlzh-cnFri, 18 Nov 2022 02:33:25 GMTFri, 18 Nov 2022 02:33:25 GMT60How are dtLinks created in NavMeshhttp://www.shnenglu.com/jinq0123/archive/2022/11/18/229525.html閲戝簡閲戝簡Fri, 18 Nov 2022 02:03:00 GMThttp://www.shnenglu.com/jinq0123/archive/2022/11/18/229525.htmlhttp://www.shnenglu.com/jinq0123/comments/229525.htmlhttp://www.shnenglu.com/jinq0123/archive/2022/11/18/229525.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/229525.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/229525.htmlHow are dtLinks created in NavMesh

(Jin Qing's Column, Nov., 2022)

dtLink defines a link between 2 polygons. It is an internal data structure.

A dtLink is owned by its source polygon.

The links are used in findPath(), to search all the neighbor polygons, from the current best polygon.

dtLink has 2 required fields:

  • neighbor: the neighbor polygon reference that is linked to.
  • edge: index of the polygon edge that owns this link. It is used in getPortalPoints() and raycast().

If the link is a boundary link, which links to other tile, then it has more fields:

  • side: defines on which side the link is. 8 sides. It is used in findPath() and raycast().
  • bmin: defines the minimum sub-edge area.
  • bmax: defines the maximum sub-edge area. bmin and bmax are used in portal finding.

Links are not saved to navmesh file. They are created on navmesh loading in addTile().

dtNavMesh::addTile() add a tile to the navmesh. A tile is a square block of the map.

The main job of dtNavMesh::addTile() is to create links inside this tile and between this tile and other tiles. Actually a block indexed by (x, y) of constant size has many layers for multi-floor map. A dtMeshTile is actually a layer with an index of (x, y, layer).

5 steps to create all links:

connectIntLinks() iterates all the polygons in the tile and create links for them by the help of neighbors information of the polygons.

2. Base off-mesh connections

baseOffMeshLinks() bases off-mesh connections to their starting polygons and connect connections inside the tile.

Off-mesh connection is between 2 points which are inside a tile or between 2 adjacent tiles.

For each off-mesh connection, there creates a specific polygon consisting of 2 vertices. See DT_POLYTYPE_OFFMESH_CONNECTION.

baseOffMeshLinks() creates 2 links for each off-mesh connection:

  • From the off-mesh connection polygon to the source polygon
  • From the source polygon to the off-mesh connection polygon

The destinaton polygon of the off-mesh connection is skipped here.

connectExtOffMeshLinks() with the source and target tile be this tile.

connectExtOffMeshLinks() searches off-mesh connections that are from this tile to the target tile by checking the side direction of the connection.

It creates a link from off-mesh connection polygon to the target tile. For bidirectional connection, it also creates a link from the target polygon to the off-mesh connection polygon.

So for each off-mesh connection of this tile, 3 or 4 links are created by baseOffMeshLinks() and connectExtOffMeshLinks(), one on the source polygon, one on the destination polygon and 1/2 on the off-mesh connection polygon.

4. Connect with layers in current tile

For each layer other than this layer in this tile:

  • Create links from this layer to other layer
  • Create links from other layer to this layer
  • Create links of the off-mesh connection from this layer to other layer
  • Create links of the off-mesh connection from other layer to this layer

5. Connect with neighbour tiles

Check 9 neighbor tiles' layers, and create links just like previous step:

  • Create links from this layer to neighnor layer
  • Create links from neighnor layer to this layer
  • Create links of the off-mesh connection from this layer to neighnor layer
  • Create links of the off-mesh connection from neighnor layer to this layer

By now, for every off-mesh connection of all the loaded tiles, 3/4 links are created.

Reference

  • https://blog.csdn.net/icebergliu1234/article/details/80322392


閲戝簡 2022-11-18 10:03 鍙戣〃璇勮
]]>
C++ parameter passing ruleshttp://www.shnenglu.com/jinq0123/archive/2022/10/29/229466.html閲戝簡閲戝簡Sat, 29 Oct 2022 03:01:00 GMThttp://www.shnenglu.com/jinq0123/archive/2022/10/29/229466.htmlhttp://www.shnenglu.com/jinq0123/comments/229466.htmlhttp://www.shnenglu.com/jinq0123/archive/2022/10/29/229466.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/229466.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/229466.htmlC++ parameter passing rules

From: https://www.modernescpp.com/index.php/c-core-guidelines-how-to-pass-function-parameters

Parameter passing expression rules:

  • F.15: Prefer simple and conventional ways of passing information
  • F.16: For “in” parameters, pass cheaply-copied types by value and others by reference to const
  • F.17: For “in-out” parameters, pass by reference to non-const
  • F.18: For “consume” parameters, pass by X&& and std::move the parameter
  • F.19: For “forward” parameters, pass by TP&& and only std::forward the parameter
  • F.20: For “out” output values, prefer return values to output parameters
  • F.21: To return multiple “out” values, prefer returning a tuple or struct
  • F.60: Prefer T* over T& when “no argument” is a valid option


閲戝簡 2022-10-29 11:01 鍙戣〃璇勮
]]>
Naming Conventions for Accessorshttp://www.shnenglu.com/jinq0123/archive/2022/09/22/229427.html閲戝簡閲戝簡Thu, 22 Sep 2022 08:02:00 GMThttp://www.shnenglu.com/jinq0123/archive/2022/09/22/229427.htmlhttp://www.shnenglu.com/jinq0123/comments/229427.htmlhttp://www.shnenglu.com/jinq0123/archive/2022/09/22/229427.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/229427.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/229427.htmlNaming Conventions for Accessors

from: C++ Programming Guidelines (cginternals.github.io)

When naming accessors within classes, non-trivial getters and queries, i.e., those that perform calculations, you should prepended get. All other getters have no prefix and setters have the set prefix.

class Object
{
public:
  int radius() const;
  void setRadius(int value);

  int getPerimeter();

private:
  int m_radius;
};

int Object::radius() const
{
    return m_radius;
}

void Object::setRadius(int value)
{
    m_radius = value;
}

int Object::getPerimeter()
{
    return 2 * pi * m_radius;
}


閲戝簡 2022-09-22 16:02 鍙戣〃璇勮
]]>
Visual Studio 2019 Compiler Hangshttp://www.shnenglu.com/jinq0123/archive/2021/07/31/217764.html閲戝簡閲戝簡Sat, 31 Jul 2021 07:16:00 GMThttp://www.shnenglu.com/jinq0123/archive/2021/07/31/217764.htmlhttp://www.shnenglu.com/jinq0123/comments/217764.htmlhttp://www.shnenglu.com/jinq0123/archive/2021/07/31/217764.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/217764.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/217764.html
(閲戝簡鐨勪笓鏍?2021.7)

Discovered by my colleague Shen Yichai:
```
Share a interesting MS Build bug:
For file a.cpp, enable optimization for Win64 or XSX.
The MSBuild always compiling without error and ending (infinite compile).
The PS5 (clang) does not have this issue.
```

The simplified code:
```
struct Tag
{
    int v;
};

void Goo(Tag* r, Tag* a)
{
    r->v = a->v;
}

void Foo(Tag* pos0, Tag* pos)
{
    for (int j = 0; j < 4; j++)
    {
        if (j == 0) {
            for (int i = 0; i < 8; i++) {
                Goo(pos0++, pos);
                Goo(pos0++, pos);
            }
        }
        else {
            for (int i = 0; i < 8; i++) {
                Goo(pos0++, pos);
                Goo(pos0++, pos);
            }
        }
    }
}

int main()
{
    Foo(nullptr, nullptr);
}
```

The default release configuration can build correctly.
But if "Properties -> C/C++ -> Optimization -> Whole Program optimization" (/GL) of file or project is changed to "No",
the compilation will take a long time as 5 minutes.

```
Microsoft Visual Studio Community 2019
Version 16.9.5
VisualStudio.16.Release/16.9.5+31229.75
Microsoft .NET Framework
Version 4.8.04084
```

閲戝簡 2021-07-31 15:16 鍙戣〃璇勮
]]>
Fbx File Format Identifierhttp://www.shnenglu.com/jinq0123/archive/2021/05/30/217692.html閲戝簡閲戝簡Sun, 30 May 2021 01:55:00 GMThttp://www.shnenglu.com/jinq0123/archive/2021/05/30/217692.htmlhttp://www.shnenglu.com/jinq0123/comments/217692.htmlhttp://www.shnenglu.com/jinq0123/archive/2021/05/30/217692.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/217692.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/217692.html
(閲戝簡鐨勪笓鏍?2021.5)

Print the list of FBX file format identifiers.

FBX SDK FbxExporter can set the file format identifier which is an int parameter.
The commnet says: User does not need to specify it by default.
If not specified, plugin will detect the file format according to file suffix automatically.

FBX SDK 2020 automatically set it to the latest binary format, which can not be parsed by "Autodesk FBX Converter 2013".
We need to specify the format identifier for FBX Converter 2013.
But there is no specification of this parameter.
We use the following code to display all the valid format identifiers and their descriptions.

```
#include <fbxsdk.h>
#include <cassert>

int main()
{
    FbxManager* myManager = FbxManager::Create();
    assert(myManager);

    FbxIOSettings* ios = FbxIOSettings::Create(myManager, IOSROOT);
    myManager->SetIOSettings(ios);

    int lFormatCount = myManager->GetIOPluginRegistry()->GetWriterFormatCount();
    for (int lFormatIndex = 0; lFormatIndex < lFormatCount; lFormatIndex++)
    {
        FbxString lDesc = myManager->GetIOPluginRegistry()->GetWriterFormatDescription(lFormatIndex);
        printf("Format index %d: %s\n", lFormatIndex, (const char*)lDesc);
    }
    return 0;
}
```

Output:
```
Format index 0: FBX binary (*.fbx)
Format index 1: FBX ascii (*.fbx)
Format index 2: FBX encrypted (*.fbx)
Format index 3: FBX 6.0 binary (*.fbx)
Format index 4: FBX 6.0 ascii (*.fbx)
Format index 5: FBX 6.0 encrypted (*.fbx)
Format index 6: AutoCAD DXF (*.dxf)
Format index 7: Alias OBJ (*.obj)
Format index 8: Collada DAE (*.dae)
Format index 9: Biovision BVH (*.bvh)
Format index 10: Motion Analysis HTR (*.htr)
Format index 11: Motion Analysis TRC (*.trc)
Format index 12: Acclaim ASF (*.asf)
Format index 13: Acclaim AMC (*.amc)
Format index 14: Vicon C3D (*.c3d)
Format index 15: Adaptive Optics AOA (*.aoa)
Format index 16: Superfluo MCD (*.mcd)
```

FBX Converter 2013 will error "File is corrupted" for files exported as *.fbx file format: -1, 0, 2, 5.
Ascii format (1, 4) and FBX 6.0 binary (3) are OK.


閲戝簡 2021-05-30 09:55 鍙戣〃璇勮
]]>
鏌ユ壘鍐呭瓨閿欒http://www.shnenglu.com/jinq0123/archive/2019/12/16/217028.html閲戝簡閲戝簡Mon, 16 Dec 2019 10:03:00 GMThttp://www.shnenglu.com/jinq0123/archive/2019/12/16/217028.htmlhttp://www.shnenglu.com/jinq0123/comments/217028.htmlhttp://www.shnenglu.com/jinq0123/archive/2019/12/16/217028.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/217028.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/217028.html
(閲戝簡鐨勪笓鏍?2019.12)

鏈嶅姟鍣ㄨ繘紼嬫湁涓伓鍙戠殑宕╂簝錛宐reakpad 涓婁紶鐨?minidump 鏄劇ず璋冪敤鏍堜笉鏄嚭閿欑殑浠g爜鐐癸紝鎬鐤戞槸鍐呭瓨閿欒銆?br />
浠庢棩蹇楀垎鏋愬彲鑳借Е鍙戝嚭閿欑殑鎸囦護錛岀劧鍚庡湪鍐呯綉璋冭瘯鐜涓嬫祴璇曪紝寰堝垢榪愬湴榪炵畫鏈夊嚑嬈″緢瀹規槗閲嶇幇浜嗐?br />
鍚庢潵鍙嶅嫻嬭瘯鍙煡錛屽彂閫佹煇涓壒孌?GM 鎸囦護 200 嬈″氨浼氬嚭鐜頒竴嬈¢敊璇紝涓鑸細鍦?100 嬈″唴鍑虹幇銆?br />浣嗘槸浠ヤ唬鐮佸弽澶嶆墽琛屽崈嬈′竾嬈¢兘涓嶈兘閲嶇幇錛屼及璁′笌鏃墮棿鏈夊叧錛岄渶瑕佹墜鍔ㄦ搷浣滃歡緇竴孌墊椂闂村悗鎵嶄細瑙﹀彂銆?br />
鍑洪敊鐐瑰鏁板湪 `boost::property_tree::ini_parser::read_ini()` 涓紝濡備笅錛?br />
```
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `./GMServer.dbg'.
Program terminated with signal 11, Segmentation fault.
#0  0x00000000010ca227 in tcmalloc::SLL_Next(void*) ()
Missing separate debuginfos, use: debuginfo-install glibc-2.17-105.el7.x86_64 libgcc-4.8.5-4.el7.x86_64 libstdc++-4.8.5-4.el7.x86_64 zlib-1.2.7-15.el7.x86_64
(gdb) bt
#0  0x00000000010ca227 in tcmalloc::SLL_Next(void*) ()
#1  0x00000000010ca2b8 in tcmalloc::SLL_TryPop(void**, void**) ()
#2  0x00000000010ca715 in tcmalloc::ThreadCache::FreeList::TryPop(void**) ()
#3  0x00000000011ebe6c in tc_newarray ()
#4  0x00007efddb7d4c69 in std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) () from /lib64/libstdc++.so.6
#5  0x0000000000a18153 in std::string::_S_construct<char*> (__beg=0x3f6c8b9 "LobbyServer]", __end=0x3f6c8c4 "]", __a=...) at /usr/include/c++/4.8.2/bits/basic_string.tcc:138
#6  0x00007efddb7d641c in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&, unsigned long, unsigned long) ()
   from /lib64/libstdc++.so.6
#7  0x00007efddb7d6462 in std::string::substr(unsigned long, unsigned long) const () from /lib64/libstdc++.so.6
#8  0x0000000000a3c3be in boost::property_tree::ini_parser::read_ini<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > > (stream=..., pt=...)
    at /var/tmp/src/f4f4f712-7894-4d98-83dd-b91be8e0555e/Linux-Debug/003_servers/../000_BaseLib/3RdParty/boost/include/boost/property_tree/ini_parser.hpp:111
#9  0x0000000000a3b2f0 in boost::property_tree::ini_parser::read_ini<boost::property_tree::basic_ptree<std::string, std::string, std::less<std::string> > > (
    filehelp="cfg.ini", pt=..., loc=...)
    at /var/tmp/src/f4f4f712-7894-4d98-83dd-b91be8e0555e/Linux-Debug/003_servers/../000_BaseLib/3RdParty/boost/include/boost/property_tree/ini_parser.hpp:169
...
#27 0x00007efddba27dc5 in start_thread () from /lib64/libpthread.so.0
#28 0x00007efddaf341cd in clone () from /lib64/libc.so.6
(gdb) q
```

浣嗘槸 property_tree 鏄疄璺佃瘉鏄庡彲闈犵殑搴擄紝鏆傛椂涓嶅幓鎬鐤戝畠銆?br />鍏朵粬浠g爜鏈?uWS 澶勭悊HTTP 璇鋒眰錛岀敤 hiredis 璇誨啓 Redis銆?br />榪欎簺搴撳厛鍋囧畾鏄紜殑錛屽厛鏌ョ湅鑷繁鐨勪唬鐮侊紝鍥犱負鐩稿叧浠g爜杈冨皯錛屽彲浠ヨ倝鐪兼煡閿欙紝鍙儨鍙煡鍒頒簺鏃犲叧鐨勫皬閿欒銆?br />
鐒跺悗鍒板娣誨姞璋冭瘯鏃ュ織錛岃窡韙彉閲忕殑鏋勯犱笌鏋愭瀯銆?br />鍥犱負 uWS 涓敤鍒頒簡涓涓敤鎴瘋嚜瀹氫箟鏁版嵁錛屾湁涓涓?new/delete 鎿嶄綔錛屽鏄撳嚭鍐呭瓨閿欒錛岄噸鐐瑰氨鏄繖涓暟鎹槸鍚﹀瓨鍦ㄩ噹鎸囬拡銆?br />浣嗘槸鐪嬩笂鍘繪甯搞?br />
鑲夌溂鏌ヤ唬鐮佷笉琛岋紝灝辮鐢ㄥ伐鍏蜂簡銆?br />
棣栧厛娣誨姞 -fstack-protector-all 緙栬瘧鍙傛暟錛岃繖涓弬鏁板叾瀹炴棤璁哄浣曢兘搴旇鏃╁氨鍔犱笂鐨勶紝鐢ㄦ潵媯嫻嬪嚱鏁拌皟鐢ㄦ椂鏍堢牬鍧忋?br />鍚屾椂鍦ㄨ嚜瀹氫箟鐢ㄦ埛鏁版嵁浣跨敤鍜屾瀽鏋勬椂媯鏌ヨ嚜韜暟鎹槸鍚︽湁鏁堬紝濡傛煇涓垚鍛樺彉閲忔繪槸璁句負 0x5a, 鏋愭瀯鏃舵墠鎶婂畠緗負 0xcc.
宕╂簝渚濇棫錛屼絾涓婅堪鍐呭瓨媯鏌ユ甯搞?br />
鍐嶄嬌鐢ㄤ竴涓?Address Sanitizer, 鍙渶瑕佹坊鍔犵紪璇戦夐」 -fsanitize=address 鍗沖彲銆?br />瀹冪敤鏉ユ鏌ュ爢鍐呭瓨鏄惁瀛樺湪闈炴硶鎿嶄綔銆?br />浣嗘槸榪欎釜涓嶈兘鍜?tcmalloc 鍏辯敤錛屾垜闇瑕佹洿鏀圭幇鏈変唬鐮侊紝鐒跺悗閾炬帴 asan 搴擄紝緇堜簬鍙互榪愯璧鋒潵浜嗐?br />濡傛灉瀛樺湪 tcmalloc 璋冪敤錛岃繘紼嬪惎鍔ㄦ椂灝變細宕╂簝銆?br />
鏁堟灉寰堝ソ錛屽噯紜姤鍛?"double-free" 閿欒錛?br />```
[jinqing@host-192-168-21-31 bin]$ gdb GMServer.dbg
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/jinqing/valkyrie/Runtime_ZT_QA/bin/GMServer.dbg...done.
(gdb) r
Starting program: /home/jinqing/valkyrie/Runtime_ZT_QA/bin/GMServer.dbg
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
iLogLevel:1
[New Thread 0x7ffff3724700 (LWP 1010)]
[New Thread 0x7ffff2c1d700 (LWP 1011)]
[New Thread 0x7ffff2116700 (LWP 1012)]
[New Thread 0x7ffff160f700 (LWP 1013)]
[New Thread 0x7ffff0b08700 (LWP 1014)]
=================================================================
==1005== ERROR: AddressSanitizer: attempting double-free on 0x6004000270d0:
    #0 0x7ffff4e60dd9 (/usr/lib64/libasan.so.0.0.0+0x15dd9)
    #1 0x1570e8d (/home/jinqing/valkyrie/Runtime_ZT_QA/bin/GMServer.dbg+0x1570e8                                                                                                         d)
0x6004000270d0 is located 0 bytes inside of 5-byte region [0x6004000270d0,0x6004                                                                                                         000270d5)
freed by thread T0 here:
    #0 0x7ffff4e60dd9 (/usr/lib64/libasan.so.0.0.0+0x15dd9)
    #1 0x1570e8d (/home/jinqing/valkyrie/Runtime_ZT_QA/bin/GMServer.dbg+0x1570e8                                                                                                         d)
previously allocated by thread T0 here:
    #0 0x7ffff4e60ef9 (/usr/lib64/libasan.so.0.0.0+0x15ef9)
    #1 0x157179e (/home/jinqing/valkyrie/Runtime_ZT_QA/bin/GMServer.dbg+0x157179                                                                                                         e)
Thread T4 created by T0 here:
    #0 0x7ffff4e55a0a (/usr/lib64/libasan.so.0.0.0+0xaa0a)
    #1 0x13fc796 (/home/jinqing/valkyrie/Runtime_ZT_QA/bin/GMServer.dbg+0x13fc79                                                                                                         6)
==1005== ABORTING
[Thread 0x7ffff160f700 (LWP 1013) exited]
[Thread 0x7ffff2116700 (LWP 1012) exited]
[Thread 0x7ffff2c1d700 (LWP 1011) exited]
[Thread 0x7ffff3724700 (LWP 1010) exited]
[Thread 0x7ffff7fe77c0 (LWP 1005) exited]
[Inferior 1 (process 1005) exited with code 01]
Missing separate debuginfos, use: debuginfo-install glibc-2.17-105.el7.x86_64 li                                                                                                         basan-4.8.5-39.el7.x86_64 libgcc-4.8.5-4.el7.x86_64 libstdc++-4.8.5-4.el7.x86_64                                                                                                          zlib-1.2.7-15.el7.x86_64
(gdb)
```

鍥犱負鐢ㄤ簡 gcc 4.8, 鎵浠san娌℃湁鍑芥暟鍚嶈緭鍑猴紝gcc 4.9 浠ヤ笂灝變細鏈夊嚱鏁板悕浜嗐?br />浣嗘槸涓嶈绱э紝鐢?nm 鍙互鎼滃埌鍑芥暟鍚嶏細

```
[jinqing@host-192-168-21-31 bin]$ nm GMServer.dbg | grep 1570e
0000000001570e50 T freeReplyObject
0000000001570ef0 T redisReaderFree
[jinqing@host-192-168-21-31 bin]$ nm GMServer.dbg | grep 15717
0000000001571750 t createStringObject
[jinqing@host-192-168-21-31 bin]$ nm GMServer.dbg | grep 13fc7
00000000013fc700 t _ZN5boost6detail23set_current_thread_dataEPNS0_16thread_data_baseE
00000000013fc7d0 T _ZN5boost6thread21start_thread_noexceptERKNS_17thread_attributesE
00000000013fc750 T _ZN5boost6thread21start_thread_noexceptEv
00000000013fc740 T _ZN5boost6threadC1Ev
00000000013fc740 T _ZN5boost6threadC2Ev
[jinqing@host-192-168-21-31 bin]$ ^C
```

鏄劇ず涓?freeReplyObject() 璋冪敤涓?"double-free".

鏈変簡榪欎釜鎻愮ず錛屾煡浠g爜灝辯畝鍗曚簡銆傚師鏉ユ煡 uWS 鐨勭敤鎴鋒暟鎹?new/delete 鏄柟鍚戞ч敊璇紝
Redis 涔熸湁涓?delete 鎿嶄綔錛屽嵆榪斿洖鐨?ReplyObject 闇瑕佽皟鐢?freeReplyObject().
鐩存帴鎼滅儲涓閬嶅氨鎵懼埌浜嗛偅涓浣欑殑 freeReplyObject.

鍘熸潵鏄?ReplyObject 淇濆瓨涓轟竴涓垚鍛樺彉閲忥紝姣忔 Redis 鎿嶄綔瀹屾垚鍚庨渶瑕佽皟鐢?freeReplyObject() 騫跺皢璇ユ垚鍛樿涓虹┖銆?br />鍚屾椂鏋愭瀯鍑芥暟涓篃浼氬垽鏂鎴愬憳錛岄潪絀哄垯璋冪敤 freeReplyObject().
浣嗘槸鏈変釜姣?60s 鎵ц涓嬈$殑 Ping 鎿嶄綔錛岃皟鐢ㄤ簡 freeReplyObject(), 浣嗘槸娌℃湁緗┖銆?br />鍚屾椂 GM 鎸囦護涔熻Е鍙戜簡涓嬈?Redis 瀵硅薄閲嶇疆錛屽啀嬈¤皟鐢ㄤ簡 freeReplyObject()銆?br />
姝g‘鐨勫仛娉曟槸涓嶇敤鎴愬憳鍙橀噺錛屾瘡嬈¢兘鐢ㄤ復鏃跺彉閲忓氨琛屼簡錛屼絾鏄敤鎴愬憳鍙橀噺鍙互灝戝啓涓琛屽0鏄庯紝鍐欎唬鐮佽緝鏂逛究銆?br />涓轟簡灝戞敼浠g爜錛屼粛鐒朵繚鎸佷負鎴愬憳鍙橀噺錛屼粎鎶婄己鐨勭疆絀鴻ˉ涓婁簡銆?br />鍚屾椂鏋愭瀯涓殑 freeReplyObject() 鏄病蹇呰鐨勶紝鏀規垚鏂█鎴愬憳涓虹┖銆?br />
娣諱簡涓琛屼唬鐮侊紝鐒跺悗嫻嬭瘯錛屽彂鐜伴敊璇笉鍑虹幇浜嗐傚鏋滀笉鍔犺繖琛岀疆絀猴紝灝?Ping 闂撮殧緙╁皬錛岀粨鏋滃嚭閿欐鐜囧ぇ澶у鍔犱簡銆?br />鐢辨紜錛岄敊璇偣宸叉壘鍒板茍淇浜嗐?br />

閲戝簡 2019-12-16 18:03 鍙戣〃璇勮
]]>
std::thread 涓殑寮傚父浼氫涪澶辮皟鐢ㄦ爤http://www.shnenglu.com/jinq0123/archive/2019/09/26/216860.html閲戝簡閲戝簡Thu, 26 Sep 2019 09:19:00 GMThttp://www.shnenglu.com/jinq0123/archive/2019/09/26/216860.htmlhttp://www.shnenglu.com/jinq0123/comments/216860.htmlhttp://www.shnenglu.com/jinq0123/archive/2019/09/26/216860.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/216860.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/216860.html
(閲戝簡鐨勪笓鏍?2019.9)

涓誨嚱鏁頒腑鐨勫紓甯哥敓鎴恈ore鏂囦歡鑳界湅鍒拌皟鐢ㄦ爤錛?br />浣嗘槸 std::thread 瀛愮嚎紼嬩腑鐨勫紓甯哥敓鎴?core 鏂囦歡鐨勮皟鐢ㄦ爤濡備笅錛?br />
```
Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7f18f00ab700 (LWP 32340)]
0x00007f19007335f7 in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00007f19007335f7 in raise () from /lib64/libc.so.6
#1  0x00007f1900734ce8 in abort () from /lib64/libc.so.6
#2  0x00007f19010379d5 in __gnu_cxx::__verbose_terminate_handler() () from /lib64/libstdc++.so.6
#3  0x00007f1901035946 in ?? () from /lib64/libstdc++.so.6
#4  0x00007f1901035973 in std::terminate() () from /lib64/libstdc++.so.6
#5  0x00007f190108c2b5 in ?? () from /lib64/libstdc++.so.6
#6  0x00007f19012e7dc5 in start_thread () from /lib64/libpthread.so.0
#7  0x00007f19007f41cd in clone () from /lib64/libc.so.6
(gdb)
```

璋冪敤鏍堜涪澶變嬌璋冭瘯鏃犳硶鎵懼埌闂鐐廣?br />
鎹 GCC 8 淇浜嗚闂銆?br />
鍙傝冿細
* [C++ uncaught exception in worker thread](https://stackoverflow.com/questions/48535100/c-uncaught-exception-in-worker-thread)
* [Bug 55917 - Impossible to find/debug unhandled exceptions in an std::thread](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55917)


閲戝簡 2019-09-26 17:19 鍙戣〃璇勮
]]>
鐢ㄨ祴鍊間唬鏇?protobuf CopyFrom()http://www.shnenglu.com/jinq0123/archive/2019/04/04/216338.html閲戝簡閲戝簡Thu, 04 Apr 2019 09:57:00 GMThttp://www.shnenglu.com/jinq0123/archive/2019/04/04/216338.htmlhttp://www.shnenglu.com/jinq0123/comments/216338.htmlhttp://www.shnenglu.com/jinq0123/archive/2019/04/04/216338.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/216338.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/216338.html
紺轟緥錛歔Replace protobuf CopyFrom with assignment](https://github.com/tensorflow/tensorflow/commit/9501c4104125fb8c2c2d2e837fc2dd8a24034d52)

protobuf 鐢熸垚鐨?C++ 浠g爜涓紝鍥犱負 CopyFrom() 鍙互鎺ュ彈浠諱綍 Message 浣滀負鍙傛暟錛?br />鎵浠ユ湁鍙兘鍦?涓笉鍚岀被鍨嬬殑娑堟伅涔嬮棿澶嶅埗銆?br />
```
  void CopyFrom(const ::google::protobuf::Message& from) final;
  void CopyFrom(const PlayerData& from);
```

鑰岃祴鍊兼搷浣滃彲浠ヤ繚璇佺被鍨嬫紜?br />
```
class PlayerData : public ::google::protobuf::Message {
 public:
  ...
  inline PlayerData& operator=(const PlayerData& from) {
    CopyFrom(from);
    return *this;
  }
  #if LANG_CXX11
  inline PlayerData& operator=(PlayerData&& from) noexcept {
    ...
  }
  #endif
```

綾誨瀷涓嶄竴鑷存椂緙栬瘧浼氭姤閿欙細
```
error: no match for ‘operator=’ (operand types are ‘a::PlayerData’ and ‘a::HeroInfo’)
```

鍙戠幇鑷繁鐢ㄤ簡澶氬勾鐨?CopyFrom() 閮芥槸閿欒鐨勪嬌鐢ㄣ?img src ="http://www.shnenglu.com/jinq0123/aggbug/216338.html" width = "1" height = "1" />

閲戝簡 2019-04-04 17:57 鍙戣〃璇勮
]]>
vs2017 linux 緙栬瘧杈撳嚭鏀規垚 vs 鏍煎紡http://www.shnenglu.com/jinq0123/archive/2018/11/21/216073.html閲戝簡閲戝簡Wed, 21 Nov 2018 02:57:00 GMThttp://www.shnenglu.com/jinq0123/archive/2018/11/21/216073.htmlhttp://www.shnenglu.com/jinq0123/comments/216073.htmlhttp://www.shnenglu.com/jinq0123/archive/2018/11/21/216073.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/216073.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/216073.htmlvs2017 linux 緙栬瘧杈撳嚭鏀規垚 vs 鏍煎紡
(閲戝簡鐨勪笓鏍?2018.11)
 1 #!/usr/bin/python 
 2 # -*- coding: utf-8 -*-  
 3 
 4 '''
 5 gcc2vs.py
 6 
 7 鍔熻兘錛?br /> 8 灝嗗壀鍒囨澘涓璯cc鐨勭紪璇戣緭鍑烘牸寮忚漿鎴恦s鏍煎紡錛岀敤浜巚s璺寵漿鍒伴敊璇銆?br /> 9 vs2017 linux 緙栬瘧杈撳嚭涓?nbsp;gcc 鏍煎紡錛屾棤娉曠偣鍑昏煩杞紝濡傦細
10 /var/tmp/src/dbe/Linux-Debug/Src/Team.cpp:16:1: 閿欒錛?#8216;x’涓嶆槸涓涓被鍨嬪悕
11 欏昏漿涓簐s鏍煎紡, 濡?br />12 /var/tmp/src/dbe/Linux-Debug/Src/Team.cpp(16):1: 閿欒錛?#8216;x’涓嶆槸涓涓被鍨嬪悕
13 
14 濡備綍浣跨敤錛?br />15 
16 棣栧厛欏誨畨瑁?nbsp;python, 騫跺畨瑁?nbsp;pyperclip
17 pip install pyperclip
18 
19 鍋囪鏈枃浠朵負 d:/tools/gcc2vs.py,
20 vs璁劇疆澶栭儴宸ュ叿錛氬伐鍏?>澶栭儴宸ュ叿->娣誨姞
21   鏍囬錛歡cc2vs(&V)
22   鍛戒護錛歱ython.exe
23   鍙傛暟錛歞:/tools/gcc2vs.py
24   閫変腑"浣跨敤杈撳嚭紿楀彛"
25 
26 鍙傝冿細VS2010鎵嬪姩娣誨姞澶栭儴宸ュ叿鍜屽揩鎹烽敭  
27 https://www.cnblogs.com/ChinaHook/p/4698733.html
28 
29 褰揕inux鏋勫緩杈撳嚭鍚庯紝鐐瑰嚮杈撳嚭紿楀彛錛宑trl-A 閫夋嫨鍏ㄩ儴錛宑trl-C 澶嶅埗杈撳嚭鍒板壀鍒囨澘錛?br />30 鐒跺悗 alt-T,V 榪愯娣誨姞鐨勫閮ㄥ伐鍏?nbsp;gcc2vs(&V), 鏇存敼杈撳嚭鏍煎紡錛岀劧鍚庡氨鍙互鐐瑰嚮閿欒璺寵漿浜嗐?br />31 '''
32 
33 import re
34 import pyperclip
35 
36 # 寰呮浛鎹㈢殑鏍煎紡
37 pattern = re.compile(r'/var/tmp/src/..-.-.-.-/Linux-Debug/(.*):([0-9]*):([0-9]*): ')
38 
39 test_lines_src = '''
40 /var/tmp/src/db71a8ec-90bb-2838-98df-2dd35e71166e/Linux-Debug/003_servers/103_LobbyServer/Src/Team.cpp:16:1: 閿欒錛?#8216;x’涓嶆槸涓涓被鍨嬪悕
41 鐢熸垚澶辮觸銆?br />42 '''
43 test_lines_dst = '''
44 003_servers/103_LobbyServer/Src/Team.cpp(16):1: 閿欒錛?#8216;x’涓嶆槸涓涓被鍨嬪悕
45 鐢熸垚澶辮觸銆?br />46 '''
47 assert test_lines_dst == re.sub(pattern, r'\1(\2):\3: ', test_lines_src)
48 
49 # 鍓垏鏉夸腑鐨刧cc鏍煎紡杈撳嚭
50 src = pyperclip.paste()
51 # 杞垚vs鏍煎紡
52 dst = re.sub(pattern, r'\1(\2):\3: ', src)
53 print(dst)
54 


閲戝簡 2018-11-21 10:57 鍙戣〃璇勮
]]>
涓?LiteIDE 娣誨姞閫変腑鏍囪http://www.shnenglu.com/jinq0123/archive/2018/01/06/215458.html閲戝簡閲戝簡Sat, 06 Jan 2018 03:05:00 GMThttp://www.shnenglu.com/jinq0123/archive/2018/01/06/215458.htmlhttp://www.shnenglu.com/jinq0123/comments/215458.htmlhttp://www.shnenglu.com/jinq0123/archive/2018/01/06/215458.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/215458.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/215458.html涓?LiteIDE 娣誨姞閫変腑鏍囪

(閲戝簡鐨勪笓鏍?2018.1)

"[Eclipse Mark Occurrences](http://www.eclipse.org/pdt/help/html/mark_occurrences.htm)"
鍙互鍦ㄦ粴鍔ㄦ潯鏃佽竟鏄劇ず鏂囦腑鎵鏈夐変腑鐨勬爣璁幫紝
鍙互閫変腑鏌愪釜鍙橀噺鏄劇ず鏈夊灝戝紩鐢ㄣ備笉榪?GoClipse 娌℃湁 "Mark Occurrences" 鍔熻兘銆?br />VS code 鏈夋鍔熻兘銆?br />
LiteIDE 瀵逛簬build閿欒浼氭樉紺鴻繖縐嶆爣璁幫紝鎵浠ユ劅瑙夊彲浠ヤ緷姝ゅ疄鐜?Mark Occurrences"銆?br />
棣栧厛鎵懼埌浜嗘墦鏍囪鐨勫姛鑳姐傛爣璁扮敤鍒伴鑹詫紝鎵浠ユ悳'QColor', 鎵懼埌浜嗭細
```c++
QColor markTypeColor(LiteApi::EditorNaviagteType type)
```

鐩稿叧鐨勬帴鍙d細鐢ㄥ埌錛?br />```c++
    void insertNavigateMark(int line, LiteApi::EditorNaviagteType type, const QString &msg, const char* tag);
    void clearAllNavigateMark(LiteApi::EditorNaviagteType types, const char *tag);
```

瀵繪壘閫変腑鏃惰Е鍙戞爣璁扮殑浠g爜錛岄変腑鎴栨悳绱㈡椂浼氭湁鍦嗚妗嗗湀鍑猴紝鎼?find", 鎵懼埌錛?br />```c++
if (!m_findExpression.isEmpty()) {
    if (!findInBlock(block,m_findExpression,pos,m_findFlags,cur)) {
        break;
    }
    ...
    painter.drawRoundedRect(offsetX+left,r.top()+l.y(),right-left,l.height(),3,3);
} else if (!m_selectionExpression.isEmpty()) {
    if (!findInBlock(block,m_selectionExpression,pos,QTextDocument::FindWholeWords,cur)) {
        break;
    }
    ...
    painter.drawRoundedRect(offsetX+left,r.top()+l.y(),right-left,l.height(),3,3);
}
```

鍙戠幇鐢繪柟妗嗕粎鍦ㄥ彲瑙嗗尯鍩熴傜畫緇ф煡鎵?m_findExpression 鍜?m_selectionExpression 鏇存敼澶勶紝
娣誨姞 'updateNavigateMarks()'

```c++
void LiteEditorWidgetBase::setFindOption(LiteApi::FindOption *opt)
{
    ...
+   updateNavigateMarks(LiteApi::EditorNavigateFind);
    viewport()->update();
}
```

```c++
void LiteEditorWidgetBase::slotSelectionChanged()
{
    ...
        m_selectionExpression.setPattern(pattern);
+       updateNavigateMarks(LiteApi::EditorNavigateSelection);
        viewport()->update();
    ...
}
```

欏繪坊鍔?涓柊鐨勭被鍨嬶細
```c++
enum EditorNaviagteType{
    EditorNavigateNormal = 1,
    EditorNavigateWarning = 2,
    EditorNavigateError = 4,
    EditorNavigateReload = 8,
+   EditorNavigateFind = 16,
+   EditorNavigateSelection = 32,
    EditorNavigateBad = EditorNavigateWarning|EditorNavigateError
};
```

鎼滅儲 `EditorNavigateWarning`, 鎵懼埌鍥犳柊澧炵被鍨嬮』鏇存敼浼樺厛綰ц〃鍜岄鑹插嚱鏁般?br />
```c++
const int PRIORITYLIST_LENGTH = 7;
const LiteApi::EditorNaviagteType MARKTYPE_PRIORITYLIST[PRIORITYLIST_LENGTH] = {
        ..., LiteApi::EditorNavigateFind, LiteApi::EditorNavigateSelection, ...
    };
...
inline QColor markTypeColor(LiteApi::EditorNaviagteType type) {
    switch(type) {
    ...
    case LiteApi::EditorNavigateNormal:
        return Qt::darkGreen;
    case LiteApi::EditorNavigateReload:
        return Qt::darkBlue;
    }
}
```

鏇存柊鏍囪鏃跺厛娓呯┖錛岀劧鍚庨愯鎼滅儲娣誨姞鏍囪錛?br />```c++
// Update selections or find marks.
void LiteEditorWidgetBase::updateNavigateMarks(LiteApi::EditorNaviagteType type)
{
    clearAllNavigateMark(type, "");
    ...

    QTextDocument *doc = this->document();
    for (QTextBlock it = doc->begin(); it != doc->end(); it = it.next())
    {
        if (!needToMarkBlock(it, type))
            continue;
        int lineNumber = it.blockNumber() + 1;
        insertNavigateMark(lineNumber, type, QString("%1: %2").arg(lineNumber).arg(it.text()), "");
    }
}

bool LiteEditorWidgetBase::needToMarkBlock(
    const QTextBlock &block, LiteApi::EditorNaviagteType type) const
{
    ...
    if (LiteApi::EditorNavigateFind == type)
        return findInBlock(block, m_findExpression, pos, m_findFlags, cur);
    if (LiteApi::EditorNavigateSelection == type)
        return findInBlock(block, m_selectionExpression, pos,
                           QTextDocument::FindWholeWords, cur);
    return false;
}
```

宸插悎騫朵富騫詫細
```
Revision: 43f4954b0b802eccbbf451136be600bfcec71f27
Author: Jin Qing <jinq0123@163.com>
Date: 18.1.5 19:08:26
Message:
Add "Mark Occurrences" function that marks selections and findings.

----
Modified: liteidex/src/api/liteeditorapi/liteeditorapi.h
Modified: liteidex/src/plugins/liteeditor/liteeditorwidgetbase.cpp
Modified: liteidex/src/plugins/liteeditor/liteeditorwidgetbase.h
```

閲戝簡 2018-01-06 11:05 鍙戣〃璇勮
]]>
asio 鍗忕▼涓?yieldhttp://www.shnenglu.com/jinq0123/archive/2017/12/07/215397.html閲戝簡閲戝簡Thu, 07 Dec 2017 06:51:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/12/07/215397.htmlhttp://www.shnenglu.com/jinq0123/comments/215397.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/12/07/215397.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/215397.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/215397.html

asio 鍗忕▼涓?yield


(閲戝簡鐨勪笓鏍?2017.12)


https://stackoverflow.com/questions/26127458/yielding-in-boost-asio-stackful-coroutine


Asio spawn() 鍙互浜х敓涓涓崗紼嬶紝鍗忕▼涓彲浠ヨ皟鐢?async_read(..., yield), async_write(..., yield), 浣嗘槸涓嶇煡閬撳浣曚富鍔ㄩ噴鏀炬帶鍒舵潈(yield)?


asio::spawn(strand_, [this, self](asio::yield_context yield)
{
    while (!computationFinished)
    {
        computeSomeMore();
        yield; // WHAT SHOULD THIS LINE BE?
    }
}


絳旀鏄細

iosvc.post(yield);


鍏朵粬榪樺彲浠ユ槸

iosvc.poll_one();

iosvc.poll();


搴旇鏄?post(yield) 鏈鍚堥傘?/p>


... polling the io_service avoids the context switch overhead, but unhandled exceptions from handlers will unwind and destroy the coroutine.




閲戝簡 2017-12-07 14:51 鍙戣〃璇勮
]]>
Lua鍜孋++涔嬮棿璋冪敤鏁堢巼嫻嬭瘯http://www.shnenglu.com/jinq0123/archive/2017/08/30/215209.html閲戝簡閲戝簡Wed, 30 Aug 2017 09:25:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/08/30/215209.htmlhttp://www.shnenglu.com/jinq0123/comments/215209.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/08/30/215209.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/215209.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/215209.htmlLua鍜孋++涔嬮棿璋冪敤鏁堢巼嫻嬭瘯

(閲戝簡鐨勪笓鏍?2017.8)

浠跨収 http://www.cnblogs.com/archy_yu/p/3185608.html 瀵?Lua 鍜?C++ 璋冪敤榪涜嫻嬭瘯銆?br />
浠g爜瑙侊細https://github.com/jinq0123/TimerLuaIntf

浣跨敤 LuaIntf 緇戝畾 Lua 鍜?C++銆傜敤 boost timer 璁℃椂銆?br />渚濊禆搴?lua-cpp, lua-intf, boost-timer 鐢?conan 瀹夎銆?br />conan 浼氫笅杞芥簮鐮侊紝緙栬瘧錛岀劧鍚庣敓鎴?conanbuildinfo.props 緇?VS 瀵煎叆錛?br />鍏朵腑璁懼ソ浜嗘墍鏈?include, lib 鐩綍錛岄摼鎺ュ簱錛岃繍琛屽簱銆?br />
浠g爜澶ф濡備笅錛?br />
    cout << "C++ calls lua add() many times:\n";
    {
        boost::timer::auto_cpu_timer t;
        for (int i = 0; i < COUNT; ++i)
            test.dispatchStatic("add", 123, 456);
    }
    cout << "C++ calls lua add_times() once:\n";
    {
        boost::timer::auto_cpu_timer t;
        test.dispatchStatic("add_times", 123, 456, COUNT);
    }
    cout << "Lua calls C++ add() many times:\n";
    {
        boost::timer::auto_cpu_timer t;
        test.dispatchStatic("test_c_add", 123, 456, COUNT);
    }
    cout << "Lua calls C++ add_times() once:\n";
    {
        boost::timer::auto_cpu_timer t;
        test.dispatchStatic("test_c_add_times", 123, 456, COUNT);
    }

嫻嬭瘯4縐嶈皟鐢細
* C++ 璋冪敤 1kw 嬈?lua add()
* C++ 璋冪敤 1 嬈?lua add_times(), 鍏朵腑璋冪敤 add() 1kw 嬈?br />* Lua 璋冪敤 C++ add() 1kw 嬈?br />* Lua 璋冪敤 C++ add_times() 1 嬈★紝鍏朵腑璋冪敤 add() 1kw 嬈?br />
杈撳嚭濡傦細
C++ calls lua add() many times:
 2.759473s wall, 2.761218s user + 0.000000s system = 2.761218s CPU (100.1%)
C++ calls lua add_times() once:
 0.436400s wall, 0.436803s user + 0.000000s system = 0.436803s CPU (100.1%)
Lua calls C++ add() many times:
 0.535802s wall, 0.530403s user + 0.000000s system = 0.530403s CPU (99.0%)
Lua calls C++ add_times() once:
 0.000005s wall, 0.000000s user + 0.000000s system = 0.000000s CPU (n/a%)
 
緇撹鏄細
* C++ 璋冪敤 Lua 鍙揪 3鐧句竾嬈?s
* Lua 鍐呴儴璋冪敤鍑芥暟鍙揪 2鍗冧竾嬈″己/s
* Lua 璋冪敤 C++ 鍑芥暟鍙揪 2鍗冧竾嬈″急/s


閲戝簡 2017-08-30 17:25 鍙戣〃璇勮
]]>
conan-transit鏈嶄笂鐨勫簱鍒楄〃http://www.shnenglu.com/jinq0123/archive/2017/08/05/215141.html閲戝簡閲戝簡Sat, 05 Aug 2017 05:14:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/08/05/215141.htmlhttp://www.shnenglu.com/jinq0123/comments/215141.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/08/05/215141.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/215141.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/215141.html闃呰鍏ㄦ枃

閲戝簡 2017-08-05 13:14 鍙戣〃璇勮
]]>
Premake 鐢熸垚 Makefile 鐨勭己鐪侀厤緗?/title><link>http://www.shnenglu.com/jinq0123/archive/2017/07/31/215133.html</link><dc:creator>閲戝簡</dc:creator><author>閲戝簡</author><pubDate>Mon, 31 Jul 2017 07:00:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2017/07/31/215133.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/215133.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2017/07/31/215133.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/215133.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/215133.html</trackback:ping><description><![CDATA[<div>Premake 鐢熸垚 Makefile 鐨勭己鐪侀厤緗?br /><br />(閲戝簡鐨勪笓鏍?2017.7)<br /><br /><span style="color:#000099;"><span style="background-color: #ffffff;">premake5.exe --os=linux gmake</span></span><br /><br />鐢熸垚鐨?Makefile 涓湁涓?config, 鐢?make 鐢熸垚release鐗堟湰鏃朵嬌鐢ㄤ互涓嬪懡浠?<br /><br /><span style="color:#000099;">make config=release_x64</span><br /><br />鍦╬remake5.lua涓彲浠ュ涓嬭緗紝浣縞onfig緙虹渷涓?release_x64錛?br /><br /><span style="color:#660000;">workspace "AppWorkspace"<br />    configurations { "Release", "Debug" }<br />    platforms { "x64", "x32" }<br />    ...<br /></span><br />鍗崇己鐪侀厤緗負 configurations 鍜?platforms 鐨勯涓夐」銆?br /><br />鐢熸垚鐨?Makefile 涓細濡備笅鍒濆鍖?config:<br /><br /><span style="color:#660000;">ifndef config<br />  config=release_x64<br />endif<br /></span><br />榪欐牱 make 灝變細緙虹渷鐢熸垚 release_x64銆?/div><img src ="http://www.shnenglu.com/jinq0123/aggbug/215133.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">閲戝簡</a> 2017-07-31 15:00 <a href="http://www.shnenglu.com/jinq0123/archive/2017/07/31/215133.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>VC6宸ョ▼鍥犺灝炬牸寮忔棤娉曡漿鎹㈠埌VS2015http://www.shnenglu.com/jinq0123/archive/2017/06/07/214981.html閲戝簡閲戝簡Wed, 07 Jun 2017 02:22:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/06/07/214981.htmlhttp://www.shnenglu.com/jinq0123/comments/214981.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/06/07/214981.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214981.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214981.htmlVC6宸ョ▼鍥犺灝炬牸寮忔棤娉曡漿鎹㈠埌VS2015

(閲戝簡鐨勪笓鏍?2017.6)

鍙傝冿細
https://connect.microsoft.com/VisualStudio/feedback/details/546432/problems-with-vs2010rc-doing-conversion-of-vs6-dsp-file-vcproj-file

apr
 娑堟伅
 apr.dsp: 鏃犳硶杞崲欏圭洰銆傝紜繚榪欐槸涓涓湁鏁堢殑 Visual C++ 6.0 欏圭洰銆?
 apr.dsp: 欏圭洰鍗囩駭澶辮觸銆?
 apr.dsp: 杞崲欏圭洰鏂囦歡“E:\temp\apr-1.5.2\apr-1.5.2\apr.dsp”銆?

鍘熸潵涓嬭澆鐨勬槸 zip 鍖呭彲浠ユ甯歌漿鎹㈠崌綰с?br />鐜板湪涓嬭澆浜?bz 鍘嬬緝鍖咃紝瑙e紑鍚庢槸Unix鏍煎紡錛屾墍浠ュ嚭鐜版棤娉曡漿鎹€?br />杞垚Windows鏍煎紡鍚庡氨鍙互浜嗐?br />

閲戝簡 2017-06-07 10:22 鍙戣〃璇勮
]]>
std::hash瀹炵幇澶畝鍗曞垎甯冧笉鍖http://www.shnenglu.com/jinq0123/archive/2017/05/26/214959.html閲戝簡閲戝簡Fri, 26 May 2017 04:00:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/05/26/214959.htmlhttp://www.shnenglu.com/jinq0123/comments/214959.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/05/26/214959.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214959.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214959.html
std::hash瀹炵幇澶畝鍗曞垎甯冧笉鍖

(閲戝簡鐨勪笓鏍?2017.5)

#include <iostream>
#include <functional>

using namespace std;

int main()
{
    std::hash<int> hasher;
    cout << hasher(2) << endl;
    cout << hasher(3) << endl;
    cout << hasher(4) << endl;

    return 0;
}


杈撳嚭涓?br />jinqing@server:~/test$ g++ main.cpp -std=c++11
jinqing@server:~/test$ ./a.out
2
3
4

鏌ョ湅瀹炵幇錛?usr/include/c++/5/bits/functional_hash.h

      operator()(_Tp __val) const noexcept              \
      { return static_cast<size_t>(__val); }            \

鎵浠ュ鍒嗗竷鏈夎姹傜殑錛屽簲璇ヤ嬌鐢ㄨ嚜宸辯殑hash, 涓嶈浣跨敤 std::hash.

boost::hash 鐨勫疄鐜頒篃鏄畝鍗曞彇鍊鹼紝
boost_1_60_0/boost/functional/hash/hash.hpp

    template <typename T>
    typename boost::hash_detail::basic_numbers<T>::type hash_value(T v)
    {
        return static_cast<std::size_t>(v);
    }

Boost璇存槑浜唄ash鐢ㄤ簬STL瀹瑰櫒錛岃屼笉鏄叾瀹冦?br />    This hash function is designed to be used in containers based on the STL and is not suitable as a general purpose hash function.
    
VS2015浼氫嬌鐢?FNV-1a

    size_t operator()(const argument_type& _Keyval) const
        {    // hash _Keyval to size_t value by pseudorandomizing transform
        return (_Hash_seq((const unsigned char *)_Keyval.c_str(),
            _Keyval.size() * sizeof (_Elem)));
        }


    inline size_t _Hash_seq(const unsigned char *_First, size_t _Count)
        {    // FNV-1a hash function for bytes in [_First, _First + _Count)
            ...


浣?FNV-1a 涔熶笉鏄氱敤鐨?hash 鍑芥暟錛屽鏋滆緭鍏ュ肩浉榪戯紝鍒欏叾杈撳嚭鍊間篃鐩歌繎銆?br />


閲戝簡 2017-05-26 12:00 鍙戣〃璇勮
]]>
鐢╬reload鍔犺澆Lua瀵煎嚭妯″潡http://www.shnenglu.com/jinq0123/archive/2017/05/10/214923.html閲戝簡閲戝簡Wed, 10 May 2017 08:11:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/05/10/214923.htmlhttp://www.shnenglu.com/jinq0123/comments/214923.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/05/10/214923.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214923.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214923.html
鐢╬reload鍔犺澆Lua瀵煎嚭妯″潡

(閲戝簡鐨勪笓鏍?2017.5)

鍙傝冿細
How to make exported module non-global?
https://github.com/SteveKChiu/lua-intf/issues/135

鍔ㄦ佸簱鍙互榪欐牱瀵煎嚭妯″潡錛?br />
    extern "C"
    #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CODEGEARC__)
    __declspec(dllexport)
    #endif
    int luaopen_modname(lua_State* L)
    {
        LuaRef mod = LuaRef::createTable(L);
        LuaBinding(mod)
            ...;
        mod.pushToStack();
        return 1;
    }

濡傛灉涓嶆槸鍔ㄦ佸簱錛屽彲浠ヨ繖鏍峰鍑哄叏灞妯″潡 c_util錛?br />
int main()
{
    ...
    LuaBinding(L).beginModule("c_util")
        .addFunction("foo", []() { return 123; })
    .endModule();
    ...
}

濡傛灉涓嶆兂璁╁畠鎴愪負鍏ㄥ眬妯″潡錛屽垯闇瑕佸湪 package.preload 琛ㄤ腑娉ㄥ唽涓涓姞杞藉嚱鏁?

Lua紼嬪簭璁捐 絎?鐗?鑻辨枃鐗?programming in lua 3ed

The preload searcher allows the definition of an arbitrary function to load a module.
It uses a table, called package.preload, to map module names to loader functions.
When searching for a module name, this searcher simply looks for the given name in the table.
If it finds a function there, it returns this function as the module loader.
Otherwise, it returns nil.
This searcher provides a generic method to handle some non-conventional situations.
For instance, a C library statically linked to Lua can register its luaopen_ function into the preload table,
so that it will be called only when (and if) the user requires that module.
In this way, the program does not waste time opening the module if it is not used.

浠g爜紺轟緥錛?br />
    extern "C" int open_my_module(lua_State* L)
    {
        LuaRef mod = LuaRef::createTable(L);
        LuaBinding(mod)
            .addFunction("get_my_svr_id", &Util::GetMySvrId)
            ;
        mod.pushToStack();
        return 1;
    }

    int main()
    {
        ...
        LuaRef table(L, "package.preload");
        table["c_util"] = LuaRef::createFunctionWith(L, open_my_module);
        ...
    }

Lua 嫻嬭瘯錛?br />    assert(c_util == nil)
    local t = require("c_util")
    assert("table" == type(t))
    assert("function" == type(t.get_my_svr_id))



閲戝簡 2017-05-10 16:11 鍙戣〃璇勮
]]>
grpc++涓嶆敮鎸佸紓姝ュ嬈″啓鍏?/title><link>http://www.shnenglu.com/jinq0123/archive/2017/05/07/214914.html</link><dc:creator>閲戝簡</dc:creator><author>閲戝簡</author><pubDate>Sun, 07 May 2017 02:38:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2017/05/07/214914.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/214914.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2017/05/07/214914.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/214914.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/214914.html</trackback:ping><description><![CDATA[<div><p>grpc++涓嶆敮鎸佸紓姝ュ嬈″啓鍏?/p><p><br /></p><p>(閲戝簡鐨勪笓鏍?2017.5)</p><p><br /></p>瑙侊細<br /><br />Multi ClientAsyncWriter::Write() calls will crash. #7659<br />https://github.com/grpc/grpc/issues/7659<br /><br />why the continuous write to async streaming crash? #4007<br />https://github.com/grpc/grpc/issues/4007<br /><br />write stream error:GRPC_CALL_ERROR_ALREADY_INVOKED <br />https://github.com/grpc/grpc/issues/3953<br /><br />grpc_cb 鏀寔鐪熸鐨勫紓姝ュ啓銆?br />https://github.com/jinq0123/grpc_cb</div><img src ="http://www.shnenglu.com/jinq0123/aggbug/214914.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">閲戝簡</a> 2017-05-07 10:38 <a href="http://www.shnenglu.com/jinq0123/archive/2017/05/07/214914.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鏀寔 proto3 鐨?lua 緇戝畾搴?LuaPbIntfhttp://www.shnenglu.com/jinq0123/archive/2017/04/25/214883.html閲戝簡閲戝簡Tue, 25 Apr 2017 03:43:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/04/25/214883.htmlhttp://www.shnenglu.com/jinq0123/comments/214883.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/04/25/214883.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214883.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214883.html鏀寔 proto3 鐨?lua 緇戝畾搴?LuaPbIntf

(閲戝簡鐨勪笓鏍?2017.4)

protobuf鐨刲ua緇戝畾搴撲箣鍓嶄竴鐩寸敤 pbc錛屼絾鏄搴撳凡緇忎笉鏇存柊浜嗐?br />鎯寵娣誨姞 proto3 鐨?map , 榪樻湁鏀寔 service, 鍙戠幇浠g爜澶珮娣憋紝鏃犳硶涓嬫墜銆?br />
pbc鍥犱負鐢╟浠g爜瀹炵幇浜?protobuf 鐨勫姛鑳斤紝鎵浠ヤ唬鐮侀噺寰堝ぇ銆?br />鑰屽浜?c++ 鏉ヨ錛屽彧闇瑕佸埄鐢?protobuf 搴撲腑鍔ㄦ佹秷鎭氨鍙互瀹炵幇 lua 鎵闇鍔熻兘銆?br />
luapb 灝辨槸鐩存帴鐢?protobuf 搴撳皝瑁呭悗瀵煎嚭lua瀹炵幇鐨勩傝搴撲粎鏀寔 proto2.

鍦?luapb 鍩虹涓婂疄鐜板 proto3 鐨勬敮鎸侊紝灝辨槸 LuaPbIntf 搴撱?br />LuaPbIntf 搴撳埄鐢ㄤ簡 lua-intf 搴撴潵瀹炵幇 c++ 涓?lua 緇戝畾錛屾墍浠ヤ唬鐮侀噺姣?luapb 鍙堝皯浜嗚澶氾紝
騫朵笖鍙鎬уぇ澶у寮猴紝鏇存敼娣誨姞鏂板姛鑳戒篃灝辨洿鏂逛究浜嗐?br />
涓?pbc, lubpb 涓鏍鳳紝LuaPbIntf 涔熸槸鍔ㄦ佸姞杞?proto 鏂囦歡錛屼笉闇瑕佷唬鐮佺敓鎴愩?br />
LuaPbIntf 閲囩敤 lua table 鏉ヨ〃紺?pb 娑堟伅錛屼笉鏄?pbc 涓殑浠g悊琛紝鑰屽彧鏄櫘閫氳〃銆?br />
欏圭洰鍦板潃錛?a >https://github.com/jinq0123/LuaPbIntf

紺轟緥錛?br />
local pb = require("luapbintf")

pb.import_proto_file("test.proto")

local msg = { uid = 12345 }
local sz = pb.encode("test.TestMsg", msg)

local msg2 = pb.decode("test.TestMsg", sz)
assert(msg2.uid == 12345)

proto3 map 紺轟緥錛?br />
local msgs = {}
msgs["k1"] = {}
msgs["k2"] = {}
pb.encode("test.TestMsg", { msgs = msgs })

rpc service 鏀寔:

assert(pb.get_rpc_input_name("test.Test", "Foo") == "test.TestMsg")
assert(pb.get_rpc_output_name("test.Test", "Foo") == "test.CommonMsg")


閲戝簡 2017-04-25 11:43 鍙戣〃璇勮
]]>
寤鴻proto鏂囦歡鎸夊寘鍚嶅垎瀛愮洰褰?/title><link>http://www.shnenglu.com/jinq0123/archive/2017/04/17/214862.html</link><dc:creator>閲戝簡</dc:creator><author>閲戝簡</author><pubDate>Mon, 17 Apr 2017 06:40:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2017/04/17/214862.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/214862.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2017/04/17/214862.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/214862.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/214862.html</trackback:ping><description><![CDATA[<div>寤鴻proto鏂囦歡鎸夊寘鍚嶅垎瀛愮洰褰?br /><br />(閲戝簡鐨勪笓鏍?2017.4)<br /><br />鏈嶅姟鍣ㄥ鎴風涔嬮棿鐨刾rotobuf鍗忚瀹氫箟鍦ㄥ鎴風涓庢湇鍔″櫒鍏叡鐩綍涓嬶紝鍖呭悕涓簉pc.<br />鏈嶅姟鍣ㄥ唴閮ㄥ崗璁畾涔夊湪鏈嶅姟鍣ㄧ洰褰曚笅錛屽寘鍚嶄負svr.<br />rpc.EmptyMsg 鍜?svr.EmptyMsg 鍒嗗埆瀹氫箟鍦ㄥ悇鑷殑鏍圭洰褰曪紝鏂囦歡鍚嶉兘鏄?empty_msg.proto.<br />榪愯鏃跺氨浼氭姤閿欙細<br /><br /><span style="color: #0000ff;">[libprotobuf ERROR E:\deps\protobuf-3.2.0\protobuf-3.2.0\src\google\protobuf\</span><br /><span style="color: #0000ff;">descriptor_database.cc:57] File already exists in database : empty_msg.proto</span><br /><span style="color: #0000ff;">[libprotobuf FATAL E:\deps\protobuf-3.2.0\protobuf-3.2.0\src\google\protobuf\</span><br /><span style="color: #0000ff;">descriptor.cc:1275] CHECK failed: generated_database_->Add(encoded_file_descriptor, size):</span><br /><br />鍘熷洜涓鴻瘯鍥劇敤鍚屼竴涓枃浠跺悕"empty_msg.proto"寰descriptor_database娣誨姞descriptor銆?br /><br />濡傛灉鎸夊寘鍚嶅垎瀛愮洰褰曪紝鏂囦歡鍚嶅氨鍙互鍒嗗紑涓?"rpc/empty_msg.proto" 鍜?"svr/empty_msg.proto".<br /><br /></div><img src ="http://www.shnenglu.com/jinq0123/aggbug/214862.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">閲戝簡</a> 2017-04-17 14:40 <a href="http://www.shnenglu.com/jinq0123/archive/2017/04/17/214862.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>behaviac鍔ㄦ佸簱榪愯鍑洪敊http://www.shnenglu.com/jinq0123/archive/2017/03/16/214755.html閲戝簡閲戝簡Thu, 16 Mar 2017 03:40:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/03/16/214755.htmlhttp://www.shnenglu.com/jinq0123/comments/214755.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/03/16/214755.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214755.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214755.htmlbehaviac鍔ㄦ佸簱榪愯鍑洪敊

(閲戝簡鐨勪笓鏍?2017.3.16)

娓告垙鏄潤鎬侀摼鎺ョ殑榪愯搴擄紝娣誨姞behaviac鍔ㄦ佸簱鍚庯紝榪愯鍑洪敊錛?br />
>    ucrtbased.dll!free_dbg_nolock(void * const block, const int block_use) 琛?996    C++
     ucrtbased.dll!_free_dbg(void * block, int block_use) 琛?1030    C++
     libbehaviac_msvc_debug.dll!operator delete(void * block) 琛?17    C++
     libbehaviac_msvc_debug.dll!std::_Deallocate(void * _Ptr, unsigned int _Count, unsigned int _Sz) 琛?132    C++
     libbehaviac_msvc_debug.dll!std::allocator<std::_Container_proxy>::deallocate(std::_Container_proxy * _Ptr, unsigned int _Count) 琛?720    C++
     libbehaviac_msvc_debug.dll!std::_Wrap_alloc<std::allocator<std::_Container_proxy> >::deallocate(std::_Container_proxy * _Ptr, unsigned int _Count) 琛?988    C++
     libbehaviac_msvc_debug.dll!std::_String_alloc<std::_String_base_types<char,std::allocator<char> > >::_Free_proxy() 琛?661    C++
     libbehaviac_msvc_debug.dll!std::_String_alloc<std::_String_base_types<char,std::allocator<char> > >::~_String_alloc<std::_String_base_types<char,std::allocator<char> > >() 琛?629    C++
     libbehaviac_msvc_debug.dll!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >() 琛?1018    C++
     libbehaviac_msvc_debug.dll!behaviac::CTagObject::Save(behaviac::IIONode * node, const char * szClassName) 琛?100    C++
     libbehaviac_msvc_debug.dll!behaviac::Agent::InitVariableRegistry() 琛?476    C++
     libbehaviac_msvc_debug.dll!behaviac::Agent::Init_(int contextId, behaviac::Agent * pAgent, short priority, const char * agentInstanceName) 琛?227    C++
     giant_test_client.exe!behaviac::Agent::InitAgent(behaviac::Agent * pAgent, const char * agentInstanceName, const char * agentInstanceNameAny, bool bToBind, int contextId, short priority) 琛?56    C++
     giant_test_client.exe!behaviac::Agent::Create<PlaneAgent>(const char * agentInstanceName, int contextId, short priority) 琛?88    C++
     giant_test_client.exe!Client::InitPlayer() 琛?36    C++
     giant_test_client.exe!Client::Client() 琛?23    C++
     giant_test_client.exe!main() 琛?50    C++
     giant_test_client.exe!invoke_main() 琛?64    C++
     giant_test_client.exe!__scrt_common_main_seh() 琛?253    C++
     giant_test_client.exe!__scrt_common_main() 琛?296    C++
     giant_test_client.exe!mainCRTStartup() 琛?17    C++
     kernel32.dll!@BaseThreadInitThunk@12()    鏈煡
     ntdll.dll!___RtlUserThreadStart@8()    鏈煡
     ntdll.dll!__RtlUserThreadStart@8()    鏈煡

鐪嬫潵鏄痵tring璺ㄨ秺鍔ㄦ佸簱鏋愭瀯銆?br />濡傛灉string鍦ㄥ姩鎬佸簱涓瀯閫犲張鏋愭瀯錛屽姩鎬佸簱鐨勮繍琛屾椂搴撳彲浠ヤ笌涓葷▼搴忎笉鍚屻?br />浣嗗鏋滅敤涓葷▼搴忕殑榪愯鏃剁敵璇峰唴瀛橈紝鍦ㄥ姩鎬佸簱涓敤鍙︿竴涓繍琛屾椂搴撻噴鏀撅紝灝變細浜х敓涓婇潰鐨勯敊璇?br />
鍙互寤虹珛涓涓渶灝忓寲鐨勭▼搴忔潵澶嶇幇涓婇潰鐨勯敊璇?br />鏂板緩涓涓涓烘爲錛屼負Agent鍒涘緩涓涓睘鎬с?br />鐒跺悗涓葷▼搴忚繍琛屽簱璁句負錛氬綰跨▼璋冭瘯 (/MTd)錛岃屼笉鏄細澶氱嚎紼嬭皟璇?DLL (/MDd)銆?br />璋冭瘯榪愯鍒涘緩Agent鏃跺氨浼氬嚭涓婇潰閿欒銆?

鐤戦棶鏄繖鏄姩鎬佸簱鍐呴儴璋冪敤錛屾庝箞浼氫駭鐢熻法搴撴瀽鏋勫憿錛?br />
鏂偣榪涘叆string鐨勬瀯閫犺繃紼嬪彲浠ュ彂鐜幫紝string涓嶆槸鍔ㄦ佸簱鏋勯犵殑錛岃屾槸涓葷▼搴忔瀯閫犵殑錛?br />
>    test_client.exe!behaviac::StringUtils::internal::ToString(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & val) 琛?138    C++
     test_client.exe!behaviac::StringUtils::Detail::ToStringPtrHanler<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,0>::ToString(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & v) 琛?192    C++
     test_client.exe!behaviac::StringUtils::Detail::ToStringEnumHanler<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,0>::ToString(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & v) 琛?228    C++
     test_client.exe!behaviac::StringUtils::Detail::ToStringStructHanler<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,0>::ToString(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & val) 琛?242    C++
     test_client.exe!behaviac::StringUtils::ToString<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & val) 琛?256    C++
     test_client.exe!behaviac::SetFromString_t<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,0>::Get(std::basic_string<char,std::char_traits<char>,std::allocator<char> > & value) 琛?790    C++
     test_client.exe!behaviac::CProperty<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::GetValueToString(const behaviac::Agent * self) 琛?848    C++
     libbehaviac_msvc_debug.dll!behaviac::CTagObject::Save(behaviac::IIONode * node, const char * szClassName) 琛?97    C++
     libbehaviac_msvc_debug.dll!behaviac::Agent::InitVariableRegistry() 琛?476    C++
     libbehaviac_msvc_debug.dll!behaviac::Agent::Init_(int contextId, behaviac::Agent * pAgent, short priority, const char * agentInstanceName) 琛?227    C++
     test_client.exe!behaviac::Agent::InitAgent(behaviac::Agent * pAgent, const char * agentInstanceName, const char * agentInstanceNameAny, bool bToBind, int contextId, short priority) 琛?56    C++
     test_client.exe!behaviac::Agent::Create<PlaneAgent>(const char * agentInstanceName, int contextId, short priority) 琛?88    C++
     test_client.exe!Client::InitPlayer() 琛?36    C++
     test_client.exe!Client::Client() 琛?23    C++
     test_client.exe!main() 琛?50    C++
     test_client.exe!invoke_main() 琛?64    C++
     test_client.exe!__scrt_common_main_seh() 琛?253    C++
     test_client.exe!__scrt_common_main() 琛?296    C++
     test_client.exe!mainCRTStartup() 琛?17    C++
     kernel32.dll!75c3336a()    鏈煡
     [涓嬮潰鐨勬鏋跺彲鑳戒笉姝g‘鍜?鎴栫己澶憋紝娌℃湁涓?kernel32.dll 鍔犺澆絎﹀彿]    
     ntdll.dll!76fa9902()    鏈煡
     ntdll.dll!76fa98d5()    鏈煡

鍘熷洜涓?IProperty::GetValueToString()鏄櫄鍑芥暟錛屽疄闄呭疄鐜版槸鐢變富紼嬪簭瀹炵幇妯℃澘綾匯?br />    behaviac::CProperty<>::GetValueToString()

瑙e喅鏂規涓轟嬌鐢╞ehaviac闈欐佸簱騫朵笖闈欐侀摼鎺ヨ繍琛屾椂搴撱?br />

閲戝簡 2017-03-16 11:40 鍙戣〃璇勮
]]>
Lua53 premakehttp://www.shnenglu.com/jinq0123/archive/2017/02/18/214686.html閲戝簡閲戝簡Sat, 18 Feb 2017 14:18:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/02/18/214686.htmlhttp://www.shnenglu.com/jinq0123/comments/214686.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/02/18/214686.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214686.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214686.htmlLua53 premake

(閲戝簡鐨勪笓鏍?2017.2)

鍙傝冿細鐢╬remake5鍒涘緩lua532宸ョ▼
      http://blog.csdn.net/jq0123/article/details/51242780

-- premake5.lua
--[[
Usage examples:
   for windows: premake5.exe --os=windows vs2015
   fot linux:   premake5.exe --os=linux gmake
]]

workspace "lua53"
   configurations { "Debug", "Release" }
   targetdir "bin/%{cfg.buildcfg}"

   language "C++"
   -- Force VS to compile as C++.
   -- https://github.com/premake/premake-core/issues/142
   filter "action:vs*"
      buildoptions "/TP"

   filter "system:windows"
      defines { "LUA_BUILD_AS_DLL" }

   filter "configurations:Debug"
      defines { "DEBUG" }
      flags { "Symbols" }

   filter "configurations:Release"
      defines { "NDEBUG" }
      optimize "On"

project "lua53"
   kind "ConsoleApp"
   files { "src/lua.c" }
   links { "lua53_shared_lib" }   

project "luac53"
   kind "ConsoleApp"
   files { "src/luac.c" }
   links { "lua53_static_lib" }  -- Link error on Windows if link lua53 shared lib.   

project "lua53_shared_lib"
   kind "SharedLib"
   targetname "lua53"
   files { "src/*.h", "src/*.c" }
   removefiles { "src/lua.c", "src/luac.c" }

project "lua53_static_lib"
   kind "StaticLib"
   targetname "lua53"
   filter "system:windows"
      targetprefix "lib"  -- liblua53.lib
   filter {}
   files { "src/*.h", "src/*.c" }
   removefiles { "src/lua.c", "src/luac.c" }
      
鏇存敼涔嬪錛?br />* VS寮哄埗鎸塁++緙栬瘧
* 鍒涘緩鍔ㄦ佸簱鍜岄潤鎬佸簱
* lua53.exe 閾炬帴鍔ㄦ佸簱錛宭uac53.exe 閾炬帴闈欐佸簱
  鍥犱負 luac53.exe 閾炬帴鍔ㄦ佸簱緙?涓嚱鏁版湭瀵煎嚭銆?br />* 娣誨姞瀹?LUA_BUILD_AS_DLL錛屼笉鐒?lua53.dll 涓嶄細鐢熸垚 lua53.lib   
 

閲戝簡 2017-02-18 22:18 鍙戣〃璇勮
]]>
鐢╣rpc_cb浠f浛grpc++http://www.shnenglu.com/jinq0123/archive/2017/01/22/214626.html閲戝簡閲戝簡Sun, 22 Jan 2017 10:06:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/01/22/214626.htmlhttp://www.shnenglu.com/jinq0123/comments/214626.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/01/22/214626.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214626.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214626.html

鐢╣rpc_cb浠f浛grpc++

(閲戝簡鐨勪笓鏍?2017.1)

jinq0123/grpc_cb
鏄?Google gRpc 鐨凜++搴撱?
瀹冧緷璧栦簬 grpc, 閲囩敤鍥炶皟鎺ュ彛錛岀畝鍖栦簡浣跨敤錛岀敤鏉ヤ唬鏇?grpc++ 搴撱?/p>

浣跨敤綆浠嬪涓嬨?/p>

瀹氫箟鏈嶅姟

鐢?proto 鏂囦歡瀹氫箟鏈嶅姟錛?/p>

 

// See examples/protos/route_guide.proto.

syntax = "proto3";

package routeguide;

// Interface exported by the server.
service RouteGuide {
  // A simple RPC.
  rpc GetFeature(Point) returns (Feature) {}
}

message Point {
  int32 latitude = 1;
  int32 longitude = 2;
}

message Feature {
  string name = 1;
  Point location = 2;
}
鐢熸垚鏈嶅姟鍣ㄥ拰瀹㈡埛绔唬鐮?p> 

璇﹁錛歟xamples/protos/generate.bat

        protoc.exe -I . --cpp_out=../cpp_cb/route_guide route_guide.proto
        protoc.exe -I . --grpc_out=../cpp_cb/route_guide --plugin=protoc-gen-grpc=grpc_cpp_cb_plugin.exe route_guide.proto
鍦╡xamples/cpp_cb/route_guide/ 鐢熸垚浠ヤ笅鏂囦歡:
  • route_guide.pb.h, 娑堟伅綾誨畾涔?/li>
  • route_guide.pb.cc, 娑堟伅綾誨疄鐜?/li>
  • route_guide.grpc_cb.pb.h, 鏈嶅姟綾誨畾涔?/li>
  • route_guide.grpc_cb.pb.cc, 鏈嶅姟綾誨疄鐜?/li>

鐢熸垚鐨勫懡鍚嶇┖闂?code>RouteGuide灝嗗寘鍚?/p>

  • 瀹㈡埛绔嬌鐢ㄧ殑Stub綾?
  • 闇鏈嶅姟鍣ㄥ疄鐜扮殑Service綾?

瀹㈡埛绔皟鐢≧PC

鍚屾璋冪敤

ChannelSptr channel(new Channel("localhost:50051"));
Stub stub(channel);

Point point = MakePoint(0, 0);
Feature feature;
Status status = stub.BlockingGetFeature(point, &feature);

寮傛璋冪敤

stub.AsyncGetFeature(point,
[](const Feature& feature) {
cout << feature.name() << endl;
});

鏈嶅姟鍣ㄥ疄鐜?/h2>

鍏堝疄鐜版湇鍔$被

    class RouteGuideImpl final : public routeguide::RouteGuide::Service {
    public:
        void GetFeature(const Point& point,
                const GetFeature_Replier& replier) override {
            Feature feature;
            feature.set_name("...");
            replier.Reply(feature);
        }    
    }
GetFeature()涓嶅繀绔嬪嵆搴旂瓟錛屽彲澶嶅埗淇濆瓨replier鍚庣洿鎺ヨ繑鍥烇紝 寰呭簲絳斿唴瀹瑰噯澶囧畬鎴愬悗錛屽啀璋冪敤Reply().

寮鍚湇鍔?/pre>
    Server svr;
    svr.AddListeningPort("0.0.0.0:50051");
    RouteGuideImpl service(db_path);
    svr.RegisterService(service);
    svr.BlockingRun();


閲戝簡 2017-01-22 18:06 鍙戣〃璇勮
]]>hiredis寮傛鎺ュ彛灝佽騫跺鍑哄埌Luahttp://www.shnenglu.com/jinq0123/archive/2017/01/05/214574.html閲戝簡閲戝簡Thu, 05 Jan 2017 10:42:00 GMThttp://www.shnenglu.com/jinq0123/archive/2017/01/05/214574.htmlhttp://www.shnenglu.com/jinq0123/comments/214574.htmlhttp://www.shnenglu.com/jinq0123/archive/2017/01/05/214574.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214574.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214574.htmlhiredis寮傛鎺ュ彛灝佽騫跺鍑哄埌Lua

(閲戝簡鐨勪笓鏍?2017.1)

hiredis 涓嶆敮鎸?Windows, Windows 涓嬩嬌鐢?wasppdotorg / hiredis-for-windows 銆?br />Linux 涓嬩粛鏄?redis/hiredis銆?br />hiredis-for-windows 鏄互 hiredis 0.13.3 涓哄熀紜縐繪鐨勩?br />
hiredis-for-windows 闇瑕佺◢鍔犱慨姝o細
    * 鍘婚櫎 inline 瀹?br />    * TCP_NODELAY 鏀瑰湪榪炴帴涔嬪墠璁劇疆銆?br />璇﹁鍏禝ssue.

Cluster 鏀寔閲囩敤 shinberg/cpp-hiredis-cluster銆傝繖鏄釜CPP搴擄紝鏀寔寮傛錛?br />瑕佹眰 hiredis >= 0.12.0銆?br />jinq0123/cpp-hiredis-cluster 鍦?develop 鍒嗘敮涓婃洿鏀逛簡鎺ュ彛錛岃瀹冩洿濂界敤銆?br />
鍥犱負緗戠粶搴撴槸boost asio, 鎵浠ラ渶瑕乤sio閫傞厤鍣紝閲囩敤 jinq0123/hiredis-boostasio-adapter銆?br />
cpp-hiredis-cluster 鎻愪緵鐨勬槸緇熶竴鐨凜ommand鎺ュ彛錛屾帴鏀跺瓧絎︿覆鍛戒護錛岃繑鍥?redisReply.
瀵逛簬甯哥敤鍛戒護錛岄渶瑕佹洿綆鍗曠殑鎺ュ彛銆?br />鍦↙ua鎵嬫父鏈嶅姟鍣ㄤ唬鐮佷腑鏂板緩CRedis綾伙紝灝佽 cpp-hiredis-cluster錛?br />涓哄父鐢╮edis鍛戒護灝佽鏇村ソ鐢ㄧ殑鎺ュ彛銆?br />CRedis綾誨皝瑁呬簡asio, 鎺ュ彛鏄牴鎹簲鐢ㄩ渶瑕佸畾涔夌殑錛屾墍浠ユ槸涓撶敤鎺ュ彛錛?br />涓嶅湪 cpp-hiredis-cluster 涓疄鐜般?br />
bool CRedis::Init(io_service& rIos, const std::string& sHost, uint16_t uPort)
鍒涘緩 RedisCluster 瀵硅薄銆?br />io_service 鐢ㄤ簬鍒涘緩涓涓?redis 浜嬩歡閫傞厤鍣紝
RedisCluster鍒涘緩闇瑕佷竴涓傞厤鍣ㄣ?br />sHost, uPort 鐢ㄤ簬鍒濆鍖栬繛鎺edis cluster, 鑾峰彇闆嗙兢淇℃伅銆?br />

using Cmd = RedisCluster::AsyncHiredisCommand;

bool CRedis::Init(io_service& rIos, const std::string& sHost, uint16_t uPort)
{
    m_pAdapter.reset(new Adapter(rIos));
    try
    {
        m_pCluster.reset(Cmd::createCluster("127.0.0.1", 7000, *m_pAdapter));
    }
    catch (const RedisCluster::ClusterException &e)
    {
        LOG_ERROR("Cluster exception: " << e.what());
        return false;
    }

    return true;
}

static Cmd::Action handleException(const RedisCluster::ClusterException &exception,
    RedisCluster::HiredisProcess::processState state)
{
    // Check the exception type.
    // Retry in case of non-critical exceptions.
    if (!dynamic_cast<const RedisCluster::CriticalException*>(&exception))
    {
        LOG_WARN("Exception in processing async redis callback: "
            << exception.what() << " Retry...");
        // retry to send a command to redis node
        return Cmd::RETRY;
    }
    LOG_ERROR("Critical exception in processing async redis callback: "
        << exception.what());
    return Cmd::FINISH;
}

static void handleSetReply(const redisReply &reply, const CRedis::SetCb& setCb)
{
    if (!setCb) return;
    if (reply.type == REDIS_REPLY_STATUS)
    {
        const std::string OK("OK");
        if (OK == reply.str)
        {
            setCb(true);
            return;
        }
    }

    LOG_WARN("Set reply: " << reply.str);
    setCb(false);
}

void CRedis::Set(const string& sKey, const string& sValue, const SetCb& setCb)
{
    assert(m_pCluster);
    Cmd::commandf2(*m_pCluster, sKey,
        [setCb](const redisReply& reply) {
            handleSetReply(reply, setCb);
        },
        handleException,
        "set %s %s", sKey.c_str(), sValue.c_str());
}

static void handleGetReply(const redisReply& reply,
    const CRedis::ReplyStringCb& hdlStrReply)
{
    if (!hdlStrReply) return;
    using Rt = CRedis::ReplyType;
    if (reply.type == REDIS_REPLY_NIL)
    {
        hdlStrReply(Rt::NIL, "");
        return;
    }
    std::string sReply(reply.str, reply.len);
    if (reply.type == REDIS_REPLY_STRING)
        hdlStrReply(Rt::OK, sReply);
    else
        hdlStrReply(Rt::ERR, sReply);
}

void CRedis::Get(const std::string& sKey, const ReplyStringCb& hdlStrRepl)
{
    assert(m_pCluster);
    Cmd::commandf2(*m_pCluster, sKey,
        [hdlStrRepl](const redisReply& reply) {
            handleGetReply(reply, hdlStrRepl);
        },
        handleException,
        "get %s", sKey.c_str());
}

handleException 鏄疌md::command() 鎺ュ彛涓渶瑕佺殑寮傚父澶勭悊錛岃繖閲屾槸灝介噺閲嶈瘯銆?br />
Cmd::command() 涓殑絎?涓弬鏁版槸 redis 搴旂瓟鐨勫洖璋冿紝璇誨彇 redisReply, 鐒跺悗瑙﹀彂鍛戒護鐨勫洖璋冦?br />
CRedis::Get() 鎵ц redis GET 鍛戒護錛屽浐瀹?涓弬鏁幫紝榪斿洖鏄瓧絎︿覆錛宯il, 鎴栭敊璇?br />
    enum class ReplyType
    {
        OK = 0,  // redis replys string/integer/array
        NIL = 1,  // redis replys nil
        ERR = 2,  // redis replys error status
    };

    // 綆鍗曠殑甯哥敤鍛戒護浼氳嚜鍔ㄨВ鏋恟eply, 浣跨敤鏇存槗鐢ㄧ殑鍥炶皟銆?/span>
    using ReplyStringCb = function<void (ReplyType, const string& sReply)>;

CRedis::Get() 鐨勫洖璋冨氨鏄?ReplyStringCb銆?br />
void CRedis::Set() 鐨勫洖璋冨彧闇鐭ラ亾鎴愬姛鎴栧け璐ワ紝SetCb 瀹氫箟涓猴細
    using SetCb = function<void (bool ok)>;

澶辮觸鏃朵細鏈夐敊璇俊鎭紝宸茬粺涓鎵撳嵃鏃ュ織錛屼笉鍐嶆毚闇插嚭鏉ャ?br />
SET 鍛戒護瀹屾暣鐨勫弬鏁板垪琛ㄨ繕鏈夊叾浠栧弬鏁幫細
set key value [EX seconds] [PX milliseconds] [NX|XX]

鍥犱負甯哥敤鐨勫氨 "set key value", 鍏朵粬鎵╁睍鐨勫懡浠ら渶瑕佷嬌鐢ㄩ氱敤鐨?command() 鎺ュ彛錛?br />騫墮渶瑕佽鍙?redisReply.

浣跨敤 LuaIntf 瀵煎嚭 CRedis 鍒?Lua.
鍥犱負鍙湁涓涓?CRedis, 鎵浠ュ鍑轟負妯″潡 c_redis:

#include <LuaIntf/LuaIntf.h>

namespace {

void Set(const string& sKey, const string& sValue, const LuaRef& luaSetCb)
{
    // Default is empty callback.
    auto setCb = ToFunction<CRedis::SetCb>(luaSetCb);
    GetRedis().Set(sKey, sValue, setCb);
}

void Get(const string& sKey, const LuaRef& luaReplyStringCb)
{
    auto replyStringCb = ToFunction<CRedis::ReplyStringCb>(
        luaReplyStringCb);
    GetRedis().Get(sKey, replyStringCb);
}

}  // namespace

void Bind(lua_State* L)
{
    LuaBinding(L).beginModule("c_redis")
        .addFunction("set", &Set)
        .addFunction("get", &Get)
    .endModule();
}

闇瑕佸皢 lua 鐨勫洖璋冨嚱鏁拌漿鎴?cpp 鐨勫洖璋冿細

template <class Function>
Function ToFunction(const LuaIntf::LuaRef& luaFunction)
{
    // Default is empty.
    if (!luaFunction)
        return Function();  // skip nil
    if (luaFunction.isFunction())
        return luaFunction.toValue<Function>();  // Todo: catch
    LOG_WARN_TO("ToFunction", "Lua function expected, but got "
        << luaFunction.typeName());
    return Function();
}

Lua 榪欐牱璋冪敤錛?br />c_redis.set("FOO", "1234")
c_redis.set("FOO", "1234", function(ok) print(ok) end)
c_redis.get("FOO", function(reply_type, reply)
    assert("string" == type(reply))
    if 0 == reply_type or 1 == reply_type then
        print("FOO="..reply)
    else
        print("Error: "..reply)
    end
end)

閲戝簡 2017-01-05 18:42 鍙戣〃璇勮
]]>
hiredis鐨勫悇縐峸indows鐗堟湰http://www.shnenglu.com/jinq0123/archive/2016/12/28/214562.html閲戝簡閲戝簡Wed, 28 Dec 2016 03:02:00 GMThttp://www.shnenglu.com/jinq0123/archive/2016/12/28/214562.htmlhttp://www.shnenglu.com/jinq0123/comments/214562.htmlhttp://www.shnenglu.com/jinq0123/archive/2016/12/28/214562.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214562.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214562.htmlhiredis鐨勫悇縐峸indows鐗堟湰

(閲戝簡鐨勪笓鏍?2016.12)

hiredis 鏄唴瀛樻暟鎹簱 redis 鐨勫鎴風C搴? 涓嶆敮鎸乄indows銆?br />
hiredis鐨刉indows縐繪鐗堟湰鏈夎澶氾細

desb42/hiredis
    forked from redis/hiredis
    hiredis 0.10.1
    Star 3
    
koenvandesande/hiredis
    forked from redis/hiredis
    hiredis 0.11.0
    鍦ㄦ棩蹇椾腑鎸囧嚭鍩轟簬 desb42
        Windows compatability, partially based on desb42's patch, but with cleanup and additional fixes.
    Star 8
    
wasppdotorg/hiredis-for-windows
    hiredis 0.13.3
    README.md 澶撮儴鎸囧嚭鍩轟簬 koenvandesande/hiredis
        https://github.com/redis/hiredis (0.13.3)
        https://github.com/koenvandesande/hiredis
    Star 3
    
lgsonic/hiredis-win
    hiredis 0.10.1
    Star 15

texnician/hiredis-win32
    hiredis 0.10.1
    Star 17
    
Microsoft/hiredis
    forked from redis/hiredis
    hiredis 0.11.0
    Star 11

ayrb13/hiredis-win
    hiredis 0.11.0
    Star 1

瀵逛簬鏄熸槦鏁伴兘杈冨皯鐨勬儏鍐碉紝鍒涘緩杈冩棭鐨?hiredis-win 鍜?hiredis-win32 鏄熸槦鏁頒細鍗犳嵁浼樺娍錛?br />浣嗘槸鏄熸槦鎰忎箟涓嶅ぇ銆?br />
鏀寔hiredis鐨勭増鏈槸鍏抽敭銆?br />hiredis-for-windows 鏀寔鐗堟湰鏈鏂幫紝騫朵笖娓婃簮娓呮錛屽彲浠ヤ俊璧栥?br />
Microsoft/hiredis 欏剁潃MS鐨勭墝瀛愭瘮杈冨鏄撹浜烘帴鍙楋紝鍥犱負鏄?forked from redis/hiredis錛?br />鎵浠ュ崌綰?hiredis 鍙渶澶勭悊涓嬪啿紿佸氨琛屼簡銆?br />浣嗘槸榪欎釜縐繪鏇存敼澶ぇ錛屼嬌鐢ㄤ簡IOCP, 澶氫簡涓涓獁in32_interop, 涓嶅鍏朵粬縐繪綆媧併?br />榪欏簲璇ユ槸 MSOpenTech/redis 鐨勫瓙欏圭洰錛岃錛?br />http://blog.sina.com.cn/s/blog_47379bd80102vbtb.html
Win32_Interop 閲嶅畾涔変簡涓浜沇indows API浠ユā鎷烲inux涓嬬殑POSIX鍑芥暟銆?br />鍦ㄩ」鐩腑榪炴帴hiredis.lib鍜學in32_Interop.lib鏃訛紝濡傛灉鍚屾椂榪炴帴緋葷粺搴撴枃浠訛紝
鍒欎細鍑虹幇涓緋誨垪鍐茬獊銆?br />

閲戝簡 2016-12-28 11:02 鍙戣〃璇勮
]]>
緇撴瀯浣撳垵濮嬪寲鍒楄〃閿欒http://www.shnenglu.com/jinq0123/archive/2016/12/12/214479.html閲戝簡閲戝簡Mon, 12 Dec 2016 09:16:00 GMThttp://www.shnenglu.com/jinq0123/archive/2016/12/12/214479.htmlhttp://www.shnenglu.com/jinq0123/comments/214479.htmlhttp://www.shnenglu.com/jinq0123/archive/2016/12/12/214479.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214479.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214479.html緇撴瀯浣撳垵濮嬪寲鍒楄〃閿欒

(閲戝簡鐨勪笓鏍?2016.12)

struct A
{
    int a = 0;
};

int main()
{
    A a{0};
    return 0;
}

鎶ヤ互涓嬮敊璇細

error C2440: “鍒濆鍖?#8221;: 鏃犳硶浠?#8220;initializer list”杞崲涓?#8220;A”
note: 鏃犳瀯閫犲嚱鏁板彲浠ユ帴鍙楁簮綾誨瀷錛屾垨鏋勯犲嚱鏁伴噸杞藉喅絳栦笉鏄庣‘

鍘婚櫎 A.a 鐨勭被鍐呭垵濮嬪寲灝卞ソ浜嗐?br />
struct A
{
    int a;
};

搴旇鏄坊鍔犵被鍐呭垵濮嬪寲鍚庯紝灝變笉鍐嶆湁榛樿鏋勯犲嚱鏁頒簡銆?br />

閲戝簡 2016-12-12 17:16 鍙戣〃璇勮
]]>
C++鐢↙uaIntf璋冪敤Lua浠g爜紺轟緥http://www.shnenglu.com/jinq0123/archive/2016/12/09/214475.html閲戝簡閲戝簡Fri, 09 Dec 2016 14:17:00 GMThttp://www.shnenglu.com/jinq0123/archive/2016/12/09/214475.htmlhttp://www.shnenglu.com/jinq0123/comments/214475.htmlhttp://www.shnenglu.com/jinq0123/archive/2016/12/09/214475.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214475.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214475.html

C++鐢↙uaIntf璋冪敤Lua浠g爜紺轟緥

(閲戝簡鐨勪笓鏍?2016.12)


    void LuaTest::OnResponse(uint32_t uLuaRpcId,
        const std::string& sRespContent) const
    {
        using LuaIntf::LuaRef;
        LuaRef require(m_pLuaState, "require");
        try {
            LuaRef handler = require.call<LuaRef>("client_rpc_response_handler");
            handler.dispatchStatic("handle", uLuaRpcId, sRespContent);
        }
        catch (const LuaIntf::LuaException& e) {
            std::cerr << "Failed to call lua client_rpc_response_handler.handle(), "
                << e.what() << std::endl;
        }
    }

榪欐槸嫻嬭瘯瀹㈡埛绔唬鐮侊紝鍙互鍐橪ua浠g爜嫻嬭瘯鏈嶅姟鍣紟

Lua浠g爜涓彂鍑轟竴涓猂pc璇鋒眰鏃? 浼氬湪Lua涓繚瀛樹竴涓洖璋? 寰呮敹鍒板簲絳旀椂瑙﹀彂鍥炶皟. 閫氳繃uLuaRpcId鏉ョ儲寮曡鍥炶皟.

sRespContent 鏄敹鍒扮殑搴旂瓟鍖? 灝嗗湪lua涓В鍖?

OnResponse() 灝辨槸璋冪敤浜?Lua 浠g爜:

    require("client_rpc_response_handler").handle(uLuaRpcId, sRespContent) 


閲戝簡 2016-12-09 22:17 鍙戣〃璇勮
]]>
log4cxx鐢ㄧ幆澧冨彉閲忚緗緭鍑烘枃浠跺悕http://www.shnenglu.com/jinq0123/archive/2016/12/05/214461.html閲戝簡閲戝簡Mon, 05 Dec 2016 07:31:00 GMThttp://www.shnenglu.com/jinq0123/archive/2016/12/05/214461.htmlhttp://www.shnenglu.com/jinq0123/comments/214461.htmlhttp://www.shnenglu.com/jinq0123/archive/2016/12/05/214461.html#Feedback0http://www.shnenglu.com/jinq0123/comments/commentRss/214461.htmlhttp://www.shnenglu.com/jinq0123/services/trackbacks/214461.htmllog4cxx鐢ㄧ幆澧冨彉閲忚緗緭鍑烘枃浠跺悕

(閲戝簡鐨勪笓鏍?2016.12)

鍒╃敤鐜鍙橀噺錛屽彲浠ョ敤鍚屼竴涓猯og4j.xml鏉ラ厤緗涓浉浼艱繘紼嬶紝杈撳嚭鏃ュ織鍒頒笉鍚屾枃浠躲?br />
渚嬪澶氫釜BaseApp榪涚▼浣跨敤鍚屼竴涓狟aseApp.xml閰嶇疆, SERVER_ID涓虹幆澧冨彉閲忥細

  <appender name="ROLLING" class="org.apache.log4j.RollingFileAppender">  
      <param name="File" value="log/BaseApp_${SERVER_ID}.log" />
      ...  
  </appender>

浠g爜鍚姩鏃跺厛璇誨彇server_id鍙傛暟錛岀劧鍚庤緗?SERVER_ID 鐜鍙橀噺錛岀劧鍚庡啀閰嶇疆log4cxx.

int main(int argc, char* argv[])
{
    log4cxx::NDC ndcMain("");
    if (argc < 3)
    {
        LOG_ERROR(Fmt("Usage: %s cfg_file server_id") % argv[0]);
        return -1;
    }
    uint16_t uServerId = (uint16_t)atoi(argv[2]);
    if (!Util::SetServerIdEnv(uServerId))  // for log4cxx
        return -1;

    // Must after SetServerIdEnv().
    log4cxx::xml::DOMConfigurator::configureAndWatch("log4j/BaseApp.xml", 5000);
    LOG_INFO("--------------------------- ");
    LOG_INFO(Fmt("Start base app (ID=%1%).") % uServerId);
    LOG_INFO("--------------------------- ");
    ...
}  

SetServerIdEnv() 濡備笅錛?br />
bool SetServerIdEnv(uint16_t uServerId)
{
    const char LOG_NAME[] = "SetServerIdEnv";
    static char buf[128] = {0};  // putenv need a buffer
    int nLen = snprintf(buf, sizeof(buf), "SERVER_ID=%u", uServerId);
    if (nLen < 0)
    {
        LOG_ERROR(Fmt("snprintf() failed. (%1%)%2%") % errno % strerror(errno));
        return false;
    }

    int nErr = putenv(buf);
    if (0 == nErr) return true;
    LOG_ERROR(Fmt("putenv() failed. (%1%)%2%") % errno % strerror(errno));
    return false;
}

榪愯鐩綍涓嬫湁涓猯og4cxx緙虹渷閰嶇疆 log4j.xml, 浼氳嚜鍔ㄥ姞杞斤紝
鎵浠ュ湪 log4cxx 鏄懼紡閰嶇疆涔嬪墠涔熷彲浠ヨ皟鐢ㄦ棩蹇楄緭鍑恒?br />
榪愯澶氫釜BaseApp.exe:

start  Debug\Giant_BaseApp.exe  cfg.ini 4
start  Debug\Giant_BaseApp.exe  cfg.ini 3


閲戝簡 2016-12-05 15:31 鍙戣〃璇勮
]]>
gdb涓嶇煡涓轟綍鏄劇ず2嬈℃瀽鏋?/title><link>http://www.shnenglu.com/jinq0123/archive/2016/11/18/214421.html</link><dc:creator>閲戝簡</dc:creator><author>閲戝簡</author><pubDate>Fri, 18 Nov 2016 08:19:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2016/11/18/214421.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/214421.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2016/11/18/214421.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/214421.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/214421.html</trackback:ping><description><![CDATA[<div>gdb涓嶇煡涓轟綍鏄劇ず2嬈℃瀽鏋?br /><br />(閲戝簡鐨勪笓鏍?2016.11)<br /><br />gdb 鏄劇ず2嬈?A::~A():<br /><br /><span style="color: #000080;">    (gdb) bt</span><br /><span style="color: #000080;">    #0  A::~A (this=0x602010, __in_chrg=<optimized out>) at main.cpp:10</span><br /><span style="color: #000080;">    #1  0x0000000000400a96 in A::~A (this=0x602010, __in_chrg=<optimized out>)</span><br /><span style="color: #000080;">        at main.cpp:12</span><br /><span style="color: #000080;">    #2  0x00000000004009c0 in main () at main.cpp:18</span><br /><br />浠g爜濡備笅錛?br /><br /><span style="color: #800000;">    class A</span><br /><span style="color: #800000;">    {</span><br /><span style="color: #800000;">    public:</span><br /><span style="color: #800000;">        A() {}</span><br /><span style="color: #800000;">        virtual ~A() </span><br /><span style="color: #800000;">        {</span><br /><span style="color: #800000;">            cout << "~A()" << endl;</span><br /><span style="color: #800000;">        }</span><br /><span style="color: #800000;">    };</span><br />    <br /><span style="color: #800000;">    int main()</span><br /><span style="color: #800000;">    {</span><br /><span style="color: #800000;">        A* p = new A;</span><br /><span style="color: #800000;">        delete p;</span><br /><span style="color: #800000;">        return 0;</span><br /><span style="color: #800000;">    }</span><br />    <br />鎵撴柇鐐規樉紺猴細2 locations:<br /><br /><span style="color: #000080;">    (gdb) b A::~A</span><br /><span style="color: #000080;">    Breakpoint 1 at 0x400a40: A::~A. (2 locations)</span><br /><br />瀹屾暣鐨?gdb 杈撳嚭:<br /><br /><span style="color: #000080;">    g++ -g main.cpp</span><br /><span style="color: #000080;">    [jinq@localhost test]$ gdb a.out</span><br /><span style="color: #000080;">    GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7</span><br /><span style="color: #000080;">    Copyright (C) 2013 Free Software Foundation, Inc.</span><br /><span style="color: #000080;">    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html></span><br /><span style="color: #000080;">    This is free software: you are free to change and redistribute it.</span><br /><span style="color: #000080;">    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"</span><br /><span style="color: #000080;">    and "show warranty" for details.</span><br /><span style="color: #000080;">    This GDB was configured as "x86_64-redhat-linux-gnu".</span><br /><span style="color: #000080;">    For bug reporting instructions, please see:</span><br /><span style="color: #000080;">    <http://www.gnu.org/software/gdb/bugs/>...</span><br /><span style="color: #000080;">    Reading symbols from /home/jinq/test/a.out...done.</span><br /><span style="color: #000080;">    (gdb) b A::~A</span><br /><span style="color: #000080;">    Breakpoint 1 at 0x400a40: A::~A. (2 locations)</span><br /><span style="color: #000080;">    (gdb) run</span><br /><span style="color: #000080;">    Starting program: /home/jinq/test/a.out</span><br />    <br /><span style="color: #000080;">    Breakpoint 1, A::~A (this=0x602010, __in_chrg=<optimized out>) at main.cpp:12</span><br /><span style="color: #000080;">    12          }</span><br /><span style="color: #000080;">    Missing separate debuginfos, use: debuginfo-install glibc-2.17-106.el7_2.8.x86_64 libgcc-4.8.5-4.el7.x86_64 libstdc++-4.8.5-4.el7.x86_64</span><br /><span style="color: #000080;">    (gdb) bt</span><br /><span style="color: #000080;">    #0  A::~A (this=0x602010, __in_chrg=<optimized out>) at main.cpp:12</span><br /><span style="color: #000080;">    #1  0x00000000004009c0 in main () at main.cpp:18</span><br /><span style="color: #000080;">    (gdb) s</span><br />    <br /><span style="color: #000080;">    Breakpoint 1, A::~A (this=0x602010, __in_chrg=<optimized out>) at main.cpp:10</span><br /><span style="color: #000080;">    10          {</span><br /><span style="color: #000080;">    (gdb) bt</span><br /><span style="color: #000080;">    #0  A::~A (this=0x602010, __in_chrg=<optimized out>) at main.cpp:10</span><br /><span style="color: #000080;">    #1  0x0000000000400a96 in A::~A (this=0x602010, __in_chrg=<optimized out>)</span><br /><span style="color: #000080;">        at main.cpp:12</span><br /><span style="color: #000080;">    #2  0x00000000004009c0 in main () at main.cpp:18</span><br /><span style="color: #000080;">    (gdb) ^CQuit</span><br /><span style="color: #000080;">    (gdb)</span><br /><br />铏氭瀽鏋勫嚱鏁板茍涓旀槸delete鎵嶈繖鏍楓?br /><br />Also see: http://lists.qt-project.org/pipermail/interest/2015-November/019691.html<br /><br />宸叉彁浜ug: https://sourceware.org/bugzilla/show_bug.cgi?id=20837<br /><br /><br />   </div><img src ="http://www.shnenglu.com/jinq0123/aggbug/214421.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">閲戝簡</a> 2016-11-18 16:19 <a href="http://www.shnenglu.com/jinq0123/archive/2016/11/18/214421.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>gloox閰嶇疆鑱婂ぉ瀹?/title><link>http://www.shnenglu.com/jinq0123/archive/2016/09/28/214309.html</link><dc:creator>閲戝簡</dc:creator><author>閲戝簡</author><pubDate>Wed, 28 Sep 2016 09:44:00 GMT</pubDate><guid>http://www.shnenglu.com/jinq0123/archive/2016/09/28/214309.html</guid><wfw:comment>http://www.shnenglu.com/jinq0123/comments/214309.html</wfw:comment><comments>http://www.shnenglu.com/jinq0123/archive/2016/09/28/214309.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/jinq0123/comments/commentRss/214309.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/jinq0123/services/trackbacks/214309.html</trackback:ping><description><![CDATA[<div>gloox閰嶇疆鑱婂ぉ瀹?br /><br />(閲戝簡鐨勪笓鏍?<br /><br />gloox鏄疿MPP鍗忚鐨凜++瀹㈡埛绔簱銆?br />浠ヤ笅浠g爜嫻嬭瘯鍒涘緩澶氫漢鑱婂ぉ瀹?MUC), 騫惰繘琛岄厤緗?br />鍙傜収gloox涓殑muc紺轟緥浠g爜銆?br />gloox浠g爜紺轟緥涓病鏈夎亰澶╁鐨勯厤緗?br />閰嶇疆鑱婂ぉ瀹ら渶瑕佽幏鍙栭厤緗〃鍗?DataForm), 濉ソ琛ㄥ崟鐒跺悗璋冪敤 setRoomConfig().<br />閰嶇疆琛ㄥ崟璇誨彇鏈嶅姟鍣ㄥ彂鏉ョ殑榛樿閰嶇疆錛屼粎鏇存敼浜嗗叾涓竴欏廣?br />嫻嬭瘯鏈嶅姟鍣ㄤ嬌鐢ㄤ簡ejabberd.<br /><br /><span style="font-family: Courier; color: #800000;">const char SERVER[] = "xmpp.jinqing.net";</span><br /><span style="font-family: Courier; color: #800000;">const char TESTER[] = "tester";</span><br /><span style="font-family: Courier; color: #800000;">const char PASSWORD[] = "password";</span><br /><br /><span style="font-family: Courier; color: #800000;">using namespace gloox;</span><br /><br /><span style="font-family: Courier; color: #800000;">static std::string GetTesterJid()</span><br /><span style="font-family: Courier; color: #800000;">{</span><br /><span style="font-family: Courier; color: #800000;">    return std::string(TESTER) + "@" + SERVER;</span><br /><span style="font-family: Courier; color: #800000;">}</span><br /><br /><span style="font-family: Courier; color: #800000;">static DataForm* CreateMUCConfigForm(const DataForm& form)</span><br /><span style="font-family: Courier; color: #800000;">{</span><br /><span style="font-family: Courier; color: #800000;">    DataForm* pNewFm = new DataForm(TypeSubmit);</span><br /><span style="font-family: Courier; color: #800000;">    const DataForm::FieldList& fl = form.fields();</span><br /><span style="font-family: Courier; color: #800000;">    for (const DataFormField* pFld : fl)</span><br /><span style="font-family: Courier; color: #800000;">    {</span><br /><span style="font-family: Courier; color: #800000;">        DataFormField* pNewFld = pNewFm->addField(</span><br /><span style="font-family: Courier; color: #800000;">            pFld->type(), pFld->name(), pFld->value());</span><br /><span style="font-family: Courier; color: #800000;">        if (pFld->name() == "muc#roomconfig_roomdesc")</span><br /><span style="font-family: Courier; color: #800000;">            pNewFld->setValue("RoomDesc_JinqTest");</span><br /><span style="font-family: Courier; color: #800000;">    }</span><br /><span style="font-family: Courier; color: #800000;">    return pNewFm;</span><br /><span style="font-family: Courier; color: #800000;">}</span><br /><br /><span style="font-family: Courier; color: #800000;">class MUCRoomConfigHandlerTest : public MUCRoomConfigHandler</span><br /><span style="font-family: Courier; color: #800000;">{</span><br /><span style="font-family: Courier; color: #800000;">public:</span><br /><span style="font-family: Courier; color: #800000;">    void handleMUCConfigList(MUCRoom* room, const MUCListItemList& items,</span><br /><span style="font-family: Courier; color: #800000;">        MUCOperation operation) override {}</span><br /><br /><span style="font-family: Courier; color: #800000;">    void handleMUCConfigForm(MUCRoom* room, const DataForm& form) override</span><br /><span style="font-family: Courier; color: #800000;">    {</span><br /><span style="font-family: Courier; color: #800000;">        DataForm* pNewForm = CreateMUCConfigForm(form);  // deleted in setRoomConfig()</span><br /><span style="font-family: Courier; color: #800000;">        room->setRoomConfig(pNewForm);</span><br /><span style="font-family: Courier; color: #800000;">    }</span><br /><br /><span style="font-family: Courier; color: #800000;">    void handleMUCConfigResult(MUCRoom* room, bool success,</span><br /><span style="font-family: Courier; color: #800000;">        MUCOperation operation) override {}</span><br /><span style="font-family: Courier; color: #800000;">    void handleMUCRequest(MUCRoom* room, const DataForm& form) override {}</span><br /><span style="font-family: Courier; color: #800000;">};  // class MUCRoomConfigHandlerTest</span><br /><br /><span style="font-family: Courier; color: #800000;">class CreateRoomTest : public ConnectionListener, MUCRoomHandler</span><br /><span style="font-family: Courier; color: #800000;">{</span><br /><span style="font-family: Courier; color: #800000;">public:</span><br /><span style="font-family: Courier; color: #800000;">    CreateRoomTest() : m_client(JID(GetTesterJid()), PASSWORD)</span><br /><span style="font-family: Courier; color: #800000;">    {</span><br /><span style="font-family: Courier; color: #800000;">        m_client.registerConnectionListener(this);</span><br /><span style="font-family: Courier; color: #800000;">    }</span><br /><br /><span style="font-family: Courier; color: #800000;">public:</span><br /><span style="font-family: Courier; color: #800000;">    void TestCreate()</span><br /><span style="font-family: Courier; color: #800000;">    {</span><br /><span style="font-family: Courier; color: #800000;">        m_client.setPresence(Presence::Available, -1);</span><br /><span style="font-family: Courier; color: #800000;">        JID nick(std::string("gloox@conference.") + SERVER + "/gloox");</span><br /><span style="font-family: Courier; color: #800000;">        m_pRoom.reset(new MUCRoom(&m_client, nick, this, &m_cfgHdlr));</span><br /><span style="font-family: Courier; color: #800000;">        m_client.connect();</span><br /><span style="font-family: Courier; color: #800000;">    }</span><br /><br /><span style="font-family: Courier; color: #800000;">    void onConnect() override</span><br /><span style="font-family: Courier; color: #800000;">    {</span><br /><span style="font-family: Courier; color: #800000;">        m_pRoom->join();</span><br /><span style="font-family: Courier; color: #800000;">        m_pRoom->requestRoomConfig();</span><br /><span style="font-family: Courier; color: #800000;">    }</span><br /><br /><span style="font-family: Courier; color: #800000;">    void onDisconnect(ConnectionError /*e*/) override {}</span><br /><br /><span style="font-family: Courier; color: #800000;">    bool onTLSConnect(const CertInfo& info) override</span><br /><span style="font-family: Courier; color: #800000;">    {</span><br /><span style="font-family: Courier; color: #800000;">        return true;</span><br /><span style="font-family: Courier; color: #800000;">    }</span><br /><br /><span style="font-family: Courier; color: #800000;">    void handleMUCParticipantPresence(MUCRoom * /*room*/,</span><br /><span style="font-family: Courier; color: #800000;">        const MUCRoomParticipant participant,</span><br /><span style="font-family: Courier; color: #800000;">        const Presence& presence) override {}</span><br /><br /><span style="font-family: Courier; color: #800000;">    void handleMUCMessage(MUCRoom* /*room*/,</span><br /><span style="font-family: Courier; color: #800000;">        const Message& msg, bool priv) override {}</span><br /><br /><span style="font-family: Courier; color: #800000;">    void handleMUCSubject(MUCRoom * /*room*/, const std::string& nick,</span><br /><span style="font-family: Courier; color: #800000;">        const std::string& subject) override {}</span><br /><br /><span style="font-family: Courier; color: #800000;">    void handleMUCError(MUCRoom * /*room*/, StanzaError error) override {}</span><br /><br /><span style="font-family: Courier; color: #800000;">    void handleMUCInfo(MUCRoom * /*room*/, int features,</span><br /><span style="font-family: Courier; color: #800000;">        const std::string& name, const DataForm* infoForm) override {}</span><br /><br /><span style="font-family: Courier; color: #800000;">    void handleMUCItems(MUCRoom * /*room*/,</span><br /><span style="font-family: Courier; color: #800000;">        const Disco::ItemList& items) override {}</span><br /><br /><span style="font-family: Courier; color: #800000;">    void handleMUCInviteDecline(MUCRoom * /*room*/, const JID& invitee,</span><br /><span style="font-family: Courier; color: #800000;">        const std::string& reason) override {}</span><br /><br /><span style="font-family: Courier; color: #800000;">    bool handleMUCRoomCreation(MUCRoom *room) override</span><br /><span style="font-family: Courier; color: #800000;">    {</span><br /><span style="font-family: Courier; color: #800000;">        return true;</span><br /><span style="font-family: Courier; color: #800000;">    }</span><br /><br /><span style="font-family: Courier; color: #800000;">private:</span><br /><span style="font-family: Courier; color: #800000;">    gloox::Client m_client;</span><br /><span style="font-family: Courier; color: #800000;">    MUCRoomConfigHandlerTest m_cfgHdlr;</span><br /><span style="font-family: Courier; color: #800000;">    std::unique_ptr<MUCRoom> m_pRoom;</span><br /><span style="font-family: Courier; color: #800000;">};  // class CreateRoomTest</span><br /><br /><span style="font-family: Courier; color: #800000;">int main()</span><br /><span style="font-family: Courier; color: #800000;">{</span><br /><span style="font-family: Courier; color: #800000;">    CreateRoomTest().TestCreate();</span><br /><span style="font-family: Courier; color: #800000;">    return 0;</span><br /><span style="font-family: Courier; color: #800000;">}</span><br /></div><img src ="http://www.shnenglu.com/jinq0123/aggbug/214309.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/jinq0123/" target="_blank">閲戝簡</a> 2016-09-28 17:44 <a href="http://www.shnenglu.com/jinq0123/archive/2016/09/28/214309.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.callmanager.cn" target="_blank">大蕉久久伊人中文字幕</a>| <a href="http://www.rezhei.cn" target="_blank">亚洲中文久久精品无码ww16 </a>| <a href="http://www.604664.cn" target="_blank">亚洲国产精品婷婷久久</a>| <a href="http://www.symfony.net.cn" target="_blank">久久综合久久综合久久</a>| <a href="http://www.0576yes.cn" target="_blank">久久人人爽人人精品视频</a>| <a href="http://www.dfyxw.cn" target="_blank">久久午夜伦鲁片免费无码</a>| <a href="http://www.lyag.cn" target="_blank">国产免费久久久久久无码</a>| <a href="http://www.laoji2004.cn" target="_blank">色天使久久综合网天天</a>| <a href="http://www.shaikr.cn" target="_blank">日本道色综合久久影院</a>| <a href="http://www.r3665.cn" target="_blank">免费无码国产欧美久久18</a>| <a href="http://www.vcdordvd.cn" target="_blank">日本一区精品久久久久影院</a>| <a href="http://www.sjsgsl.net.cn" target="_blank">久久久午夜精品福利内容</a>| <a href="http://www.fanggumen.cn" target="_blank">久久青青草原国产精品免费</a>| <a href="http://www.xbvz.cn" target="_blank">久久人人爽人人爽人人爽</a>| <a href="http://www.lsjtht.cn" target="_blank">91亚洲国产成人久久精品网址</a>| <a href="http://www.perou.cn" target="_blank">国内精品久久久久久久久电影网</a>| <a href="http://www.51567.cn" target="_blank">国产69精品久久久久9999</a>| <a href="http://www.jumbo8.cn" target="_blank">国产午夜福利精品久久2021 </a>| <a href="http://www.pingpangq.cn" target="_blank">久久久久久国产精品免费免费</a>| <a href="http://www.xxupng.cn" target="_blank">蜜臀av性久久久久蜜臀aⅴ</a>| <a href="http://www.enliangjiancai.cn" target="_blank">久久久久国色AV免费看图片</a>| <a href="http://www.jrlxcc.cn" target="_blank">精品久久久久久国产</a>| <a href="http://www.lwtjf.cn" target="_blank">亚洲精品乱码久久久久久久久久久久 </a>| <a href="http://www.fqvb.cn" target="_blank">国内精品九九久久精品</a>| <a href="http://www.beauty-queen.cn" target="_blank">精品久久久久久久久久中文字幕 </a>| <a href="http://www.e-zhishi.cn" target="_blank">亚洲国产精品无码久久久久久曰</a>| <a href="http://www.jiaqianli.cn" target="_blank">91精品国产乱码久久久久久</a>| <a href="http://www.caregps.cn" target="_blank">亚洲色欲久久久综合网东京热 </a>| <a href="http://www.pkx9.cn" target="_blank">久久精品国产亚洲77777</a>| <a href="http://www.gyxcs.cn" target="_blank">久久精品亚洲AV久久久无码</a>| <a href="http://www.tgbnews.cn" target="_blank">亚洲欧美日韩精品久久亚洲区 </a>| <a href="http://www.rootwiremesh.cn" target="_blank">亚洲国产另类久久久精品小说</a>| <a href="http://www.hnyongsheng.cn" target="_blank">欧美国产精品久久高清</a>| <a href="http://www.z1359.cn" target="_blank">久久九色综合九色99伊人</a>| <a href="http://www.zqdiary.cn" target="_blank">国产91久久综合</a>| <a href="http://www.up2me.cn" target="_blank">精品多毛少妇人妻AV免费久久</a>| <a href="http://www.musicweb.cn" target="_blank">久久亚洲精品中文字幕三区</a>| <a href="http://www.carnegietech.com.cn" target="_blank">97久久超碰国产精品2021</a>| <a href="http://www.0553fc.cn" target="_blank">.精品久久久麻豆国产精品</a>| <a href="http://www.fz-tm.cn" target="_blank">国产精品久久自在自线观看</a>| <a href="http://www.chengzhangtixi.cn" target="_blank">久久精品无码专区免费东京热 </a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>