vtkSMMessage.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMMessage.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
21 #ifndef vtkSMMessage_h
22 #define vtkSMMessage_h
23 
24 #if !defined(__VTK_WRAP__) && !defined(VTK_WRAPPING_CXX)
25 #include "vtkSMMessageMinimal.h"
26 
27 #include <string>
28 #if __GNUC__
29 #pragma GCC diagnostic ignored "-Wsign-compare"
30 #endif
31 
32 // include 1st
33 #include "vtkSystemIncludes.h"
34 
35 // include 2nd
36 #include "vtk_protobuf.h"
37 
38 // include 3rd
39 #include "vtkRemotingServerManagerModule.h" // needed for exports
40 
41 // include last
42 #include "vtkPVMessage.pb.h"
43 
44 #if __GNUC__
45 #pragma GCC diagnostic warning "-Wsign-compare"
46 #endif
47 
48 #include "vtkClientServerStream.h"
49 
51  vtkClientServerStream& stream, const paraview_protobuf::Variant& variant)
52 {
53  switch (variant.type())
54  {
55  case paraview_protobuf::Variant::INT:
56  for (int cc = 0; cc < variant.integer_size(); cc++)
57  {
58  stream << variant.integer(cc);
59  }
60  break;
61 
62  case paraview_protobuf::Variant::FLOAT64:
63  for (int cc = 0; cc < variant.float64_size(); cc++)
64  {
65  stream << variant.float64(cc);
66  }
67  break;
68 
69  case paraview_protobuf::Variant::IDTYPE:
70  for (int cc = 0; cc < variant.idtype_size(); cc++)
71  {
72  stream << variant.idtype(cc);
73  }
74  break;
75 
76  case paraview_protobuf::Variant::STRING:
77  for (int cc = 0; cc < variant.txt_size(); cc++)
78  {
79  stream << variant.txt(cc).c_str();
80  }
81  break;
82 
83  default:
84  break;
85  }
86  return stream;
87 }
88 
89 using namespace paraview_protobuf;
90 
91 #endif // !(defined(__VTK_WRAP__) && !defined(VTK_WRAPPING_CXX)
92 #endif
93 
94 // VTK-HeaderTest-Exclude: vtkSMMessage.h
vtkClientServerStream & operator<<(vtkClientServerStream &stream, const paraview_protobuf::Variant &variant)
Definition: vtkSMMessage.h:50
Store messages for the interpreter.