vtkSMMessage.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
9 #ifndef vtkSMMessage_h
10 #define vtkSMMessage_h
11 
12 #if !defined(__VTK_WRAP__) && !defined(VTK_WRAPPING_CXX)
13 #include "vtkSMMessageMinimal.h"
14 
15 #include <string>
16 #if __GNUC__
17 #pragma GCC diagnostic ignored "-Wsign-compare"
18 #endif
19 
20 // include 1st
21 #include "vtkSystemIncludes.h"
22 
23 // include 2nd
24 #include "vtk_protobuf.h"
25 
26 // include 3rd
27 #include "vtkRemotingServerManagerModule.h" // needed for exports
28 
29 // include last
30 #include "vtkPVMessage.pb.h"
31 
32 #if __GNUC__
33 #pragma GCC diagnostic warning "-Wsign-compare"
34 #endif
35 
36 #include "vtkClientServerStream.h"
37 
39  vtkClientServerStream& stream, const paraview_protobuf::Variant& variant)
40 {
41  switch (variant.type())
42  {
43  case paraview_protobuf::Variant::INT:
44  for (int cc = 0; cc < variant.integer_size(); cc++)
45  {
46  stream << variant.integer(cc);
47  }
48  break;
49 
50  case paraview_protobuf::Variant::FLOAT64:
51  for (int cc = 0; cc < variant.float64_size(); cc++)
52  {
53  stream << variant.float64(cc);
54  }
55  break;
56 
57  case paraview_protobuf::Variant::IDTYPE:
58  for (int cc = 0; cc < variant.idtype_size(); cc++)
59  {
60  stream << variant.idtype(cc);
61  }
62  break;
63 
64  case paraview_protobuf::Variant::STRING:
65  for (int cc = 0; cc < variant.txt_size(); cc++)
66  {
67  stream << variant.txt(cc).c_str();
68  }
69  break;
70 
71  default:
72  break;
73  }
74  return stream;
75 }
76 
77 using namespace paraview_protobuf;
78 
79 #endif // !(defined(__VTK_WRAP__) && !defined(VTK_WRAPPING_CXX)
80 #endif
81 
82 // VTK-HeaderTest-Exclude: vtkSMMessage.h
vtkClientServerStream & operator<<(vtkClientServerStream &stream, const paraview_protobuf::Variant &variant)
Definition: vtkSMMessage.h:38
Store messages for the interpreter.