Permalink
Browse files

collection, break: deprecated List object.

  • Loading branch information...
xicilion committed Oct 31, 2017
1 parent bfe47e8 commit aaa56a6bd91bedac06d5d3ca5502f3828335b7c2
Showing with 298 additions and 1,371 deletions.
  1. +0 −2 fibjs/fibjs.vcxproj
  2. +0 −6 fibjs/fibjs.vcxproj.filters
  3. +0 −2 fibjs/fibjs_gui.vcxproj
  4. +0 −6 fibjs/fibjs_gui.vcxproj.filters
  5. +3 −4 fibjs/include/HeapGraphNode.h
  6. +4 −5 fibjs/include/HeapProxy.h
  7. +2 −3 fibjs/include/HeapSnapshot.h
  8. +4 −5 fibjs/include/HttpClient.h
  9. +1 −1 fibjs/include/HttpCollection.h
  10. +1 −1 fibjs/include/HttpMessage.h
  11. +2 −3 fibjs/include/HttpRequest.h
  12. +4 −5 fibjs/include/HttpResponse.h
  13. +1 −1 fibjs/include/HttpUploadCollection.h
  14. +3 −3 fibjs/include/LevelDB.h
  15. +0 −87 fibjs/include/List.h
  16. +2 −3 fibjs/include/Message.h
  17. +5 −5 fibjs/include/Redis.h
  18. +4 −4 fibjs/include/RedisHash.h
  19. +1 −1 fibjs/include/RedisList.h
  20. +1 −1 fibjs/include/RedisSet.h
  21. +2 −2 fibjs/include/RedisSortedSet.h
  22. +33 −5 fibjs/include/SimpleObject.h
  23. +1 −2 fibjs/include/WebSocketMessage.h
  24. +1 −2 fibjs/include/WorkerMessage.h
  25. +3 −3 fibjs/include/ZipFile.h
  26. +2 −6 fibjs/include/ifs/HeapGraphNode.h
  27. +2 −4 fibjs/include/ifs/HeapSnapshot.h
  28. +2 −4 fibjs/include/ifs/HttpClient.h
  29. +2 −6 fibjs/include/ifs/HttpCollection.h
  30. +2 −4 fibjs/include/ifs/HttpMessage.h
  31. +2 −4 fibjs/include/ifs/HttpResponse.h
  32. +2 −4 fibjs/include/ifs/LevelDB.h
  33. +3 −19 fibjs/include/ifs/Message.h
  34. +5 −7 fibjs/include/ifs/Redis.h
  35. +7 −9 fibjs/include/ifs/RedisHash.h
  36. +2 −4 fibjs/include/ifs/RedisList.h
  37. +2 −4 fibjs/include/ifs/RedisSet.h
  38. +4 −6 fibjs/include/ifs/RedisSortedSet.h
  39. +9 −11 fibjs/include/ifs/ZipFile.h
  40. +0 −3 fibjs/include/ifs/collection.h
  41. +3 −5 fibjs/include/ifs/fs.h
  42. +2 −4 fibjs/include/ifs/http.h
  43. +4 −6 fibjs/include/ifs/registry.h
  44. +0 −458 fibjs/src/collection/List.cpp
  45. +3 −0 fibjs/src/collection/Map.cpp
  46. +1 −1 fibjs/src/console/console_file.cpp
  47. +1 −6 fibjs/src/coroutine/WorkerMessage.cpp
  48. +3 −4 fibjs/src/db/LevelDB.cpp
  49. +8 −10 fibjs/src/db/redis/Redis.cpp
  50. +4 −4 fibjs/src/db/redis/RedisHash.cpp
  51. +1 −1 fibjs/src/db/redis/RedisList.cpp
  52. +2 −2 fibjs/src/db/redis/RedisSet.cpp
  53. +2 −2 fibjs/src/db/redis/RedisSortedSet.cpp
  54. +2 −3 fibjs/src/fs/fs.cpp
  55. +3 −4 fibjs/src/fs/fs_posix.cpp
  56. +3 −4 fibjs/src/fs/fs_win32.cpp
  57. +3 −3 fibjs/src/http/HttpClient.cpp
  58. +3 −4 fibjs/src/http/HttpCollection.cpp
  59. +2 −3 fibjs/src/http/HttpFileHandler.cpp
  60. +1 −1 fibjs/src/http/HttpMessage.cpp
  61. +2 −7 fibjs/src/http/HttpRequest.cpp
  62. +7 −14 fibjs/src/http/HttpResponse.cpp
  63. +3 −4 fibjs/src/http/HttpUploadCollection.cpp
  64. +1 −1 fibjs/src/http/http.cpp
  65. +1 −1 fibjs/src/mq/JSHandler.cpp
  66. +2 −9 fibjs/src/mq/Message.cpp
  67. +6 −8 fibjs/src/mq/Routing.cpp
  68. +4 −5 fibjs/src/os/registry.cpp
  69. +2 −2 fibjs/src/profiler/HeapDiff.cpp
  70. +1 −1 fibjs/src/profiler/HeapGraphNode.cpp
  71. +4 −8 fibjs/src/profiler/HeapProxy.cpp
  72. +4 −8 fibjs/src/profiler/HeapSnapshot.cpp
  73. +1 −6 fibjs/src/websocket/WebSocketMessage.cpp
  74. +6 −7 fibjs/src/zip/ZipFile.cpp
  75. +1 −1 idl/zh-cn/HeapGraphNode.idl
  76. +1 −1 idl/zh-cn/HeapSnapshot.idl
  77. +1 −1 idl/zh-cn/HttpClient.idl
  78. +1 −1 idl/zh-cn/HttpCollection.idl
  79. +1 −1 idl/zh-cn/HttpMessage.idl
  80. +1 −1 idl/zh-cn/HttpResponse.idl
  81. +1 −1 idl/zh-cn/LevelDB.idl
  82. +0 −148 idl/zh-cn/List.idl
  83. +1 −1 idl/zh-cn/Message.idl
  84. +3 −3 idl/zh-cn/Redis.idl
  85. +4 −4 idl/zh-cn/RedisHash.idl
  86. +1 −1 idl/zh-cn/RedisList.idl
  87. +1 −1 idl/zh-cn/RedisSet.idl
  88. +2 −2 idl/zh-cn/RedisSortedSet.idl
  89. +3 −3 idl/zh-cn/ZipFile.idl
  90. +0 −3 idl/zh-cn/collection.idl
  91. +1 −1 idl/zh-cn/fs.idl
  92. +1 −1 idl/zh-cn/http.idl
  93. +2 −2 idl/zh-cn/registry.idl
  94. +0 −258 test/collection_test.js
  95. +1 −1 test/db_test.js
  96. +1 −1 test/fs_test.js
  97. +7 −8 test/http_test.js
  98. +15 −4 test/mq_test.js
  99. +0 −24 test/profiler_test.js
  100. +29 −29 test/redis_test.js
  101. +0 −6 test/util_test.js
View
@@ -133,7 +133,6 @@
<ClInclude Include="include\Isolate.h" />
<ClInclude Include="include\JSHandler.h" />
<ClInclude Include="include\LevelDB.h" />
<ClInclude Include="include\List.h" />
<ClInclude Include="include\Lock.h" />
<ClInclude Include="include\LruCache.h" />
<ClInclude Include="include\Map.h" />
@@ -381,7 +380,6 @@
<ClCompile Include="src\base\utf8.cpp" />
<ClCompile Include="src\base\utils.cpp" />
<ClCompile Include="src\base\v8_api.cpp" />
<ClCompile Include="src\collection\List.cpp" />
<ClCompile Include="src\collection\Map.cpp" />
<ClCompile Include="src\collection\Queue.cpp" />
<ClCompile Include="src\console\TextColor.cpp" />
@@ -240,9 +240,6 @@
<ClInclude Include="include\LevelDB.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\List.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Lock.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -971,9 +968,6 @@
<ClCompile Include="src\base\v8_api.cpp">
<Filter>Source Files\base</Filter>
</ClCompile>
<ClCompile Include="src\collection\List.cpp">
<Filter>Source Files\collection</Filter>
</ClCompile>
<ClCompile Include="src\collection\Map.cpp">
<Filter>Source Files\collection</Filter>
</ClCompile>
View
@@ -133,7 +133,6 @@
<ClInclude Include="include\Isolate.h" />
<ClInclude Include="include\JSHandler.h" />
<ClInclude Include="include\LevelDB.h" />
<ClInclude Include="include\List.h" />
<ClInclude Include="include\Lock.h" />
<ClInclude Include="include\LruCache.h" />
<ClInclude Include="include\Map.h" />
@@ -381,7 +380,6 @@
<ClCompile Include="src\base\utf8.cpp" />
<ClCompile Include="src\base\utils.cpp" />
<ClCompile Include="src\base\v8_api.cpp" />
<ClCompile Include="src\collection\List.cpp" />
<ClCompile Include="src\collection\Map.cpp" />
<ClCompile Include="src\collection\Queue.cpp" />
<ClCompile Include="src\console\TextColor.cpp" />
@@ -240,9 +240,6 @@
<ClInclude Include="include\LevelDB.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\List.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Lock.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -971,9 +968,6 @@
<ClCompile Include="src\base\v8_api.cpp">
<Filter>Source Files\base</Filter>
</ClCompile>
<ClCompile Include="src\collection\List.cpp">
<Filter>Source Files\collection</Filter>
</ClCompile>
<ClCompile Include="src\collection\Map.cpp">
<Filter>Source Files\collection</Filter>
</ClCompile>
@@ -7,7 +7,6 @@
#include "ifs/HeapGraphNode.h"
#include <v8/include/v8-profiler.h>
#include "List.h"
#ifndef _fj_HEAPGRAPHNODE_H
#define _fj_HEAPGRAPHNODE_H
@@ -18,7 +17,7 @@ class HeapSnapshot;
class HeapGraphNode : public HeapGraphNode_base {
public:
HeapGraphNode(int32_t _type, exlib::string& _name, int32_t _id,
int32_t _size, List* _childs)
int32_t _size, NArray* _childs)
: m_type(_type)
, m_name(_name)
, m_id(_id)
@@ -34,7 +33,7 @@ class HeapGraphNode : public HeapGraphNode_base {
virtual result_t get_description(exlib::string& retVal);
virtual result_t get_id(int32_t& retVal);
virtual result_t get_shallowSize(int32_t& retVal);
virtual result_t get_childs(obj_ptr<List_base>& retVal);
virtual result_t get_childs(obj_ptr<NArray>& retVal);
public:
static void get_description(HeapGraphNode_base* node, exlib::string& retVal)
@@ -75,7 +74,7 @@ class HeapGraphNode : public HeapGraphNode_base {
exlib::string m_name;
int32_t m_id;
int32_t m_shallowSize;
obj_ptr<List> m_childs;
obj_ptr<NArray> m_childs;
};
}
@@ -7,7 +7,6 @@
#include "ifs/HeapSnapshot.h"
#include "ifs/HeapGraphEdge.h"
#include "List.h"
#include <v8/include/v8-profiler.h>
#include <map>
@@ -41,7 +40,7 @@ class HeapSnapshotProxy : public HeapSnapshot_base {
virtual result_t save(exlib::string fname, AsyncEvent* ac);
virtual result_t get_time(date_t& retVal);
virtual result_t get_root(obj_ptr<HeapGraphNode_base>& retVal);
virtual result_t get_nodes(obj_ptr<List_base>& retVal);
virtual result_t get_nodes(obj_ptr<NArray>& retVal);
private:
void fill_nodes();
@@ -50,7 +49,7 @@ class HeapSnapshotProxy : public HeapSnapshot_base {
const v8::HeapSnapshot* m_snapshot;
date_t m_d;
std::map<int32_t, int32_t> _nodes;
obj_ptr<List> m_nodes;
obj_ptr<NArray> m_nodes;
};
class HeapGraphNodeProxy : public HeapGraphNode_base {
@@ -68,12 +67,12 @@ class HeapGraphNodeProxy : public HeapGraphNode_base {
virtual result_t get_description(exlib::string& retVal);
virtual result_t get_id(int32_t& retVal);
virtual result_t get_shallowSize(int32_t& retVal);
virtual result_t get_childs(obj_ptr<List_base>& retVal);
virtual result_t get_childs(obj_ptr<NArray>& retVal);
private:
weak_ptr<HeapSnapshotProxy> m_snapshot;
const v8::HeapGraphNode* m_node;
obj_ptr<List> m_childs;
obj_ptr<NArray> m_childs;
};
class HeapGraphEdgeProxy : public HeapGraphEdge_base {
@@ -7,7 +7,6 @@
#include "ifs/HeapSnapshot.h"
#include <v8/include/v8-profiler.h>
#include "List.h"
#include <map>
#ifndef _fj_HEAPSNAPSHOT_H
@@ -23,7 +22,7 @@ class HeapSnapshot : public HeapSnapshot_base {
virtual result_t save(exlib::string fname, AsyncEvent* ac);
virtual result_t get_time(date_t& retVal);
virtual result_t get_root(obj_ptr<HeapGraphNode_base>& retVal);
virtual result_t get_nodes(obj_ptr<List_base>& retVal);
virtual result_t get_nodes(obj_ptr<NArray>& retVal);
public:
result_t load(exlib::string fname);
@@ -32,7 +31,7 @@ class HeapSnapshot : public HeapSnapshot_base {
private:
date_t m_time;
obj_ptr<List> m_nodes;
obj_ptr<NArray> m_nodes;
std::map<int32_t, int32_t> _nodes;
};
}
@@ -9,7 +9,6 @@
#include "ifs/HttpClient.h"
#include "HttpCookie.h"
#include "List.h"
namespace fibjs {
@@ -23,13 +22,13 @@ class HttpClient : public HttpClient_base {
, m_autoRedirect(true)
, m_maxBodySize(-1)
{
m_cookies = new List();
m_cookies = new NArray();
m_userAgent = "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36";
}
public:
// HttpClient_base
virtual result_t get_cookies(obj_ptr<List_base>& retVal);
virtual result_t get_cookies(obj_ptr<NArray>& retVal);
virtual result_t get_timeout(int32_t& retVal);
virtual result_t set_timeout(int32_t newVal);
virtual result_t get_enableCookie(bool& retVal);
@@ -51,7 +50,7 @@ class HttpClient : public HttpClient_base {
virtual result_t find(exlib::string url, v8::Local<v8::Object> headers, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac);
public:
result_t update_cookies(exlib::string url, obj_ptr<List_base> cookies);
result_t update_cookies(exlib::string url, obj_ptr<NArray> cookies);
result_t get_cookie(exlib::string url, exlib::string& retVal);
exlib::string agent()
@@ -63,7 +62,7 @@ class HttpClient : public HttpClient_base {
result_t update(obj_ptr<HttpCookie_base> cookie);
private:
obj_ptr<List> m_cookies;
obj_ptr<NArray> m_cookies;
int32_t m_timeout;
bool m_enableCookie;
bool m_autoRedirect;
@@ -25,7 +25,7 @@ class HttpCollection : public HttpCollection_base {
virtual result_t clear();
virtual result_t has(exlib::string name, bool& retVal);
virtual result_t first(exlib::string name, Variant& retVal);
virtual result_t all(exlib::string name, obj_ptr<List_base>& retVal);
virtual result_t all(exlib::string name, obj_ptr<NArray>& retVal);
virtual result_t add(v8::Local<v8::Object> map);
virtual result_t add(exlib::string name, Variant value);
virtual result_t set(v8::Local<v8::Object> map);
@@ -47,7 +47,7 @@ class HttpMessage : public Message {
result_t get_socket(obj_ptr<Stream_base>& retVal);
result_t hasHeader(exlib::string name, bool& retVal);
result_t firstHeader(exlib::string name, Variant& retVal);
result_t allHeader(exlib::string name, obj_ptr<List_base>& retVal);
result_t allHeader(exlib::string name, obj_ptr<NArray>& retVal);
result_t addHeader(v8::Local<v8::Object> map);
result_t addHeader(exlib::string name, Variant value);
result_t setHeader(v8::Local<v8::Object> map);
@@ -29,8 +29,7 @@ class HttpRequest : public HttpRequest_base {
// Message_base
virtual result_t get_value(exlib::string& retVal);
virtual result_t set_value(exlib::string newVal);
virtual result_t get_params(obj_ptr<List_base>& retVal);
virtual result_t set_params(List_base* newVal);
virtual result_t get_params(obj_ptr<NArray>& retVal);
virtual result_t get_type(int32_t& retVal);
virtual result_t set_type(int32_t newVal);
virtual result_t get_data(v8::Local<v8::Value>& retVal);
@@ -68,7 +67,7 @@ class HttpRequest : public HttpRequest_base {
virtual result_t get_socket(obj_ptr<Stream_base>& retVal);
virtual result_t hasHeader(exlib::string name, bool& retVal);
virtual result_t firstHeader(exlib::string name, Variant& retVal);
virtual result_t allHeader(exlib::string name, obj_ptr<List_base>& retVal);
virtual result_t allHeader(exlib::string name, obj_ptr<NArray>& retVal);
virtual result_t addHeader(v8::Local<v8::Object> map);
virtual result_t addHeader(exlib::string name, Variant value);
virtual result_t setHeader(v8::Local<v8::Object> map);
@@ -27,8 +27,7 @@ class HttpResponse : public HttpResponse_base {
// Message_base
virtual result_t get_value(exlib::string& retVal);
virtual result_t set_value(exlib::string newVal);
virtual result_t get_params(obj_ptr<List_base>& retVal);
virtual result_t set_params(List_base* newVal);
virtual result_t get_params(obj_ptr<NArray>& retVal);
virtual result_t get_type(int32_t& retVal);
virtual result_t set_type(int32_t newVal);
virtual result_t get_data(v8::Local<v8::Value>& retVal);
@@ -66,7 +65,7 @@ class HttpResponse : public HttpResponse_base {
virtual result_t get_socket(obj_ptr<Stream_base>& retVal);
virtual result_t hasHeader(exlib::string name, bool& retVal);
virtual result_t firstHeader(exlib::string name, Variant& retVal);
virtual result_t allHeader(exlib::string name, obj_ptr<List_base>& retVal);
virtual result_t allHeader(exlib::string name, obj_ptr<NArray>& retVal);
virtual result_t addHeader(v8::Local<v8::Object> map);
virtual result_t addHeader(exlib::string name, Variant value);
virtual result_t setHeader(v8::Local<v8::Object> map);
@@ -81,7 +80,7 @@ class HttpResponse : public HttpResponse_base {
virtual result_t set_statusMessage(exlib::string newVal);
virtual result_t writeHead(int32_t statusCode, exlib::string statusMessage, v8::Local<v8::Object> headers);
virtual result_t writeHead(int32_t statusCode, v8::Local<v8::Object> headers);
virtual result_t get_cookies(obj_ptr<List_base>& retVal);
virtual result_t get_cookies(obj_ptr<NArray>& retVal);
virtual result_t addCookie(HttpCookie_base* cookie);
virtual result_t redirect(exlib::string url);
virtual result_t sendHeader(Stream_base* stm, AsyncEvent* ac);
@@ -90,7 +89,7 @@ class HttpResponse : public HttpResponse_base {
obj_ptr<HttpMessage> m_message;
int32_t m_statusCode;
exlib::string m_statusMessage;
obj_ptr<List_base> m_cookies;
obj_ptr<NArray> m_cookies;
};
} /* namespace fibjs */
@@ -25,7 +25,7 @@ class HttpUploadCollection : public HttpCollection_base {
virtual result_t clear();
virtual result_t has(exlib::string name, bool& retVal);
virtual result_t first(exlib::string name, Variant& retVal);
virtual result_t all(exlib::string name, obj_ptr<List_base>& retVal);
virtual result_t all(exlib::string name, obj_ptr<NArray>& retVal);
virtual result_t add(v8::Local<v8::Object> map);
virtual result_t add(exlib::string name, Variant value);
virtual result_t set(v8::Local<v8::Object> map);
View
@@ -30,7 +30,7 @@ class LevelDB : public LevelDB_base {
// LevelDB_base
virtual result_t has(Buffer_base* key, bool& retVal, AsyncEvent* ac);
virtual result_t get(Buffer_base* key, obj_ptr<Buffer_base>& retVal, AsyncEvent* ac);
virtual result_t mget(v8::Local<v8::Array> keys, obj_ptr<List_base>& retVal);
virtual result_t mget(v8::Local<v8::Array> keys, obj_ptr<NArray>& retVal);
virtual result_t set(Buffer_base* key, Buffer_base* value, AsyncEvent* ac);
virtual result_t mset(v8::Local<v8::Object> map);
virtual result_t mremove(v8::Local<v8::Array> keys);
@@ -57,8 +57,8 @@ class LevelDB : public LevelDB_base {
result_t _commit(leveldb::WriteBatch* batch, AsyncEvent* ac);
ASYNC_MEMBER1_AC(LevelDB, _commit, leveldb::WriteBatch*);
result_t _mget(std::vector<exlib::string>* keys, obj_ptr<List_base>& retVal, AsyncEvent* ac);
ASYNC_MEMBERVALUE2_AC(LevelDB, _mget, std::vector<exlib::string>*, obj_ptr<List_base>);
result_t _mget(std::vector<exlib::string>* keys, obj_ptr<NArray>& retVal, AsyncEvent* ac);
ASYNC_MEMBERVALUE2_AC(LevelDB, _mget, std::vector<exlib::string>*, obj_ptr<NArray>);
leveldb::DB* db()
{
Oops, something went wrong.

0 comments on commit aaa56a6

Please sign in to comment.