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 last
39 #include "vtkPVMessage.pb.h"
40 
41 #if __GNUC__
42 #pragma GCC diagnostic warning "-Wsign-compare"
43 #endif
44 
45 #include "vtkClientServerStream.h"
46 
48  vtkClientServerStream& stream, const paraview_protobuf::Variant& variant)
49 {
50  switch (variant.type())
51  {
52  case paraview_protobuf::Variant::INT:
53  for (int cc = 0; cc < variant.integer_size(); cc++)
54  {
55  stream << variant.integer(cc);
56  }
57  break;
58 
59  case paraview_protobuf::Variant::FLOAT64:
60  for (int cc = 0; cc < variant.float64_size(); cc++)
61  {
62  stream << variant.float64(cc);
63  }
64  break;
65 
66  case paraview_protobuf::Variant::IDTYPE:
67  for (int cc = 0; cc < variant.idtype_size(); cc++)
68  {
69  stream << variant.idtype(cc);
70  }
71  break;
72 
73  case paraview_protobuf::Variant::STRING:
74  for (int cc = 0; cc < variant.txt_size(); cc++)
75  {
76  stream << variant.txt(cc).c_str();
77  }
78  break;
79 
80  default:
81  break;
82  }
83  return stream;
84 }
85 
86 using namespace paraview_protobuf;
87 
88 #endif // !(defined(__VTK_WRAP__) && !defined(VTK_WRAPPING_CXX)
89 #endif
90 
91 // VTK-HeaderTest-Exclude: vtkSMMessage.h
vtkClientServerStream & operator<<(vtkClientServerStream &stream, const paraview_protobuf::Variant &variant)
Definition: vtkSMMessage.h:47
Store messages for the interpreter.