1 #ifndef OPCUABRIDGE_FILELIST_H_ 2 #define OPCUABRIDGE_FILELIST_H_ 4 #include "imageblock.h" 6 #include <unordered_set> 10 namespace filesystem {
19 typedef BinaryDataType block_type;
24 block_type& getBlock() {
return block_; }
25 const block_type& getBlock()
const {
return block_; }
26 void setBlock(
const block_type& block) { block_ = block; }
27 INITSERVERNODESET_BIN_FUNCTION_DEFINITION(
FileList, &block_)
28 CLIENTREAD_BIN_FUNCTION_DEFINITION(&block_)
29 CLIENTWRITE_BIN_FUNCTION_DEFINITION(&block_)
31 void setOnBeforeReadCallback(MessageOnBeforeReadCallback<FileList>::type cb) { on_before_read_cb_ = std::move(cb); }
32 void setOnAfterWriteCallback(MessageOnAfterWriteCallback<FileList>::type cb) { on_after_write_cb_ = std::move(cb); }
37 MessageOnBeforeReadCallback<FileList>::type on_before_read_cb_;
38 MessageOnAfterWriteCallback<FileList>::type on_after_write_cb_;
41 static const char* node_id_;
42 static const char* bin_node_id_;
44 Json::Value wrapMessage()
const {
48 void unwrapMessage(
const Json::Value& v) {}
50 WRAPMESSAGE_FUCTION_DEFINITION(
FileList)
51 UNWRAPMESSAGE_FUCTION_DEFINITION(
FileList)
52 READ_FUNCTION_FRIEND_DECLARATION(
FileList)
53 WRITE_FUNCTION_FRIEND_DECLARATION(
FileList)
54 INTERNAL_FUNCTIONS_FRIEND_DECLARATION(
FileList)
56 #ifdef OPCUABRIDGE_ENABLE_SERIALIZATION 57 SERIALIZE_FUNCTION_FRIEND_DECLARATION
59 DEFINE_SERIALIZE_METHOD() { SERIALIZE_FIELD(ar,
"block_", block_); }
60 #endif // OPCUABRIDGE_ENABLE_SERIALIZATION 63 typedef const FileList::block_type::value_type* FileSetEntry;
66 typedef FileSetEntry argument_type;
67 typedef std::size_t result_type;
69 result_type operator()(argument_type
const& e)
const;
73 typedef FileSetEntry argument_type;
75 bool operator()(
const argument_type& lhs,
const argument_type& rhs)
const;
78 typedef std::unordered_set<FileSetEntry, FileSetEntryHash, FileSetEntryEqual> FileUnorderedSet;
80 std::size_t UpdateFileList(
FileList* ,
const boost::filesystem::path& );
81 void UpdateFileUnorderedSet(FileUnorderedSet* ,
const FileList& );
85 #endif // OPCUABRIDGE_FILELIST_H_