bes  Updated for version 3.20.6
CacheMarshaller.h
1 // -*- mode: c++; c-basic-offset:4 -*-
2 
3 // This file is part of Hyrax, A C++ implementation of the OPeNDAP Data
4 // Access Protocol.
5 
6 // Copyright (c) 2016 OPeNDAP, Inc.
7 // Author: James Gallagher <jgallagher@opendap.org>
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 //
23 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24 
25 
26 #ifndef cache_marshaller_h
27 #define cache_marshaller_h 1
28 
29 #include <iostream>
30 
31 #include <Marshaller.h> // from libdap
32 
33 // namespace bes {
34 
42 class CacheMarshaller: public libdap::Marshaller {
43 private:
44  ostream &d_out;
45 
48  CacheMarshaller &operator=(const CacheMarshaller &);
49 
50  void put_vector(char *val, unsigned int num, int width, libdap::Type);
51 
52 public:
53  CacheMarshaller(ostream &out): Marshaller(), d_out(out) { }
54  virtual ~CacheMarshaller() { }
55 
56  virtual void put_byte(libdap::dods_byte val);
57 
58  virtual void put_int16(libdap::dods_int16 val);
59  virtual void put_int32(libdap::dods_int32 val);
60 
61  virtual void put_float32(libdap::dods_float32 val);
62  virtual void put_float64(libdap::dods_float64 val);
63 
64  virtual void put_uint16(libdap::dods_uint16 val);
65  virtual void put_uint32(libdap::dods_uint32 val);
66 
67  virtual void put_str(const string &val);
68  virtual void put_url(const string &val);
69 
70  virtual void put_opaque(char *val, unsigned int len);
71  virtual void put_int(int val);
72 
73  virtual void put_vector(char *val, int num, libdap::Vector &);
74  virtual void put_vector(char *val, int num, int width, libdap::Vector &);
75 
76  virtual void put_vector_start(int num);
77  virtual void put_vector_part(char *val, unsigned int num, int width, libdap::Type);
78  virtual void put_vector_end();
79 
80  virtual void dump(ostream &strm) const;
81 };
82 
83 // } // namespace bes
84 
85 #endif // cache_marshaller_h
86 
CacheMarshaller
Marshaller that knows how serialize dap data objects to a disk cache This class can be used with libd...
Definition: CacheMarshaller.h:42
CacheMarshaller::put_vector_end
virtual void put_vector_end()
Definition: CacheMarshaller.cc:132
CacheMarshaller::put_vector_part
virtual void put_vector_part(char *val, unsigned int num, int width, libdap::Type)
Definition: CacheMarshaller.cc:185
Type
Type
Type of JSON value.
Definition: cmr_module/rapidjson/rapidjson.h:603
CacheMarshaller::put_vector_start
virtual void put_vector_start(int num)
Definition: CacheMarshaller.cc:121