libdap++  Updated for version 3.12.0
Int64.h
Go to the documentation of this file.
1 
2 // -*- mode: c++; c-basic-offset:4 -*-
3 
4 // This file is part of libdap, A C++ implementation of the OPeNDAP Data
5 // Access Protocol.
6 
7 // Copyright (c) 2012 OPeNDAP, Inc.
8 // Author: James Gallagher <jgallagher@opendap.org>
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 //
24 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25 
26 #ifndef _int64_h
27 #define _int64_h 1
28 
29 #ifndef _dods_datatypes_h
30 #include "dods-datatypes.h"
31 #endif
32 
33 #ifndef _basetype_h
34 #include "BaseType.h"
35 #endif
36 
37 namespace libdap
38 {
39 
40 class ConstraintEvaluator;
41 class Marshaller;
42 class UnMarshaller;
43 
49 class Int64: public BaseType
50 {
51  unsigned int val2buf(void *, bool) { throw InternalErr(__FILE__, __LINE__, "Not implemented for Int64"); }
52  unsigned int buf2val(void **) { throw InternalErr(__FILE__, __LINE__, "Not implemented for Int64"); }
53 
54 protected:
56 
57 public:
58  Int64(const string &n);
59  Int64(const string &n, const string &d);
60 
61  Int64(const Int64 &copy_from);
62 
63  Int64 &operator=(const Int64 &rhs);
64 
65  virtual ~Int64();
66 
67  virtual BaseType *ptr_duplicate();
68 
69  virtual unsigned int width(bool constrained = false);
70 
71  virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval = true);
72  virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false);
73 
74  virtual bool set_value(dods_int64 i);
75  virtual dods_int64 value() const;
76 
77  virtual void print_val(FILE *out, string space = "",
78  bool print_decl_p = true);
79  virtual void print_val(ostream &out, string space = "",
80  bool print_decl_p = true);
81 
82  virtual bool ops(BaseType *b, int op);
83 
84  virtual void dump(ostream &strm) const ;
85 };
86 
87 } // namespace libdap
88 
89 #endif // _int64_h
90