ParaView
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 =========================================================================*/
22 #ifndef vtkSMMessage_h
23 #define vtkSMMessage_h
24 
25 #include "vtkSMMessageMinimal.h"
26 
27 #include <string>
28 #if __GNUC__
29 #pragma GCC diagnostic ignored "-Wsign-compare"
30 #endif
31 #include "vtkPVMessage.pb.h"
32 #include "vtkSystemIncludes.h"
33 #include "vtk_protobuf.h"
34 #if __GNUC__
35 #pragma GCC diagnostic warning "-Wsign-compare"
36 #endif
37 
38 #include "vtkClientServerStream.h"
39 
41  vtkClientServerStream& stream, const paraview_protobuf::Variant& variant)
42 {
43  switch (variant.type())
44  {
45  case paraview_protobuf::Variant::INT:
46  for (int cc = 0; cc < variant.integer_size(); cc++)
47  {
48  stream << variant.integer(cc);
49  }
50  break;
51 
52  case paraview_protobuf::Variant::FLOAT64:
53  for (int cc = 0; cc < variant.float64_size(); cc++)
54  {
55  stream << variant.float64(cc);
56  }
57  break;
58 
59  case paraview_protobuf::Variant::IDTYPE:
60  for (int cc = 0; cc < variant.idtype_size(); cc++)
61  {
62  stream << variant.idtype(cc);
63  }
64  break;
65 
66  case paraview_protobuf::Variant::STRING:
67  for (int cc = 0; cc < variant.txt_size(); cc++)
68  {
69  stream << variant.txt(cc).c_str();
70  }
71  break;
72 
73  default:
74  break;
75  }
76  return stream;
77 }
78 
79 using namespace paraview_protobuf;
80 #endif
81 
82 // VTK-HeaderTest-Exclude: vtkSMMessage.h
vtkClientServerStream & operator<<(vtkClientServerStream &stream, const paraview_protobuf::Variant &variant)
Definition: vtkSMMessage.h:40
Store messages for the interpreter.