libvisiontransfer  10.6.0
parameterserialization.h
1 /*******************************************************************************
2  * Copyright (c) 2023 Allied Vision Technologies GmbH
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *******************************************************************************/
14 
15 #ifndef VISIONTRANSFER_PARAMETERSERIALIZATION_H
16 #define VISIONTRANSFER_PARAMETERSERIALIZATION_H
17 
18 #include <vector>
19 #include <string>
20 #include <sstream>
21 
22 #include <visiontransfer/parametervalue.h>
23 #include <visiontransfer/parameter.h>
24 #include <visiontransfer/parameterset.h>
25 
26 namespace visiontransfer {
27 namespace internal {
28 
31  public:
32  // Note: the [de]serialization of metadata-only updates uses the same format as the full update (and just ignores the value part)
33  static void serializeParameterFullUpdate(std::stringstream& ss, const param::Parameter& param, const std::string& leader="I");
34  static param::Parameter deserializeParameterFullUpdate(const std::vector<std::string>& toks, const std::string& leader="I");
35  static void serializeParameterValueChange(std::stringstream& ss, const param::Parameter& param);
36  static void deserializeParameterValueChange(const std::vector<std::string>& toks, param::Parameter& param);
37  static void serializeAsyncResult(std::stringstream& ss, const std::string& requestId, bool success, const std::string& message);
38  static void deserializeAsyncResult(const std::vector<std::string>& toks, std::string& requestId, bool& success, std::string& message);
39 };
40 
41 } // namespace internal
42 } // namespace visiontransfer
43 
44 #endif
45 
46 
This is the common [de]serialization filter for all of nvparam&#39;s external network protocols...
Allied Vision