Blame tests/TestByte.h

Packit a4aae4
Packit a4aae4
// -*- mode: c++; c-basic-offset:4 -*-
Packit a4aae4
Packit a4aae4
// This file is part of libdap, A C++ implementation of the OPeNDAP Data
Packit a4aae4
// Access Protocol.
Packit a4aae4
Packit a4aae4
// Copyright (c) 2002,2003 OPeNDAP, Inc.
Packit a4aae4
// Author: James Gallagher <jgallagher@opendap.org>
Packit a4aae4
//
Packit a4aae4
// This library is free software; you can redistribute it and/or
Packit a4aae4
// modify it under the terms of the GNU Lesser General Public
Packit a4aae4
// License as published by the Free Software Foundation; either
Packit a4aae4
// version 2.1 of the License, or (at your option) any later version.
Packit a4aae4
//
Packit a4aae4
// This library is distributed in the hope that it will be useful,
Packit a4aae4
// but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit a4aae4
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit a4aae4
// Lesser General Public License for more details.
Packit a4aae4
//
Packit a4aae4
// You should have received a copy of the GNU Lesser General Public
Packit a4aae4
// License along with this library; if not, write to the Free Software
Packit a4aae4
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit a4aae4
//
Packit a4aae4
// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
Packit a4aae4
Packit a4aae4
// (c) COPYRIGHT URI/MIT 1995-1997,1999
Packit a4aae4
// Please read the full copyright statement in the file COPYRIGHT_URI.
Packit a4aae4
//
Packit a4aae4
// Authors:
Packit a4aae4
//      jhrg,jimg       James Gallagher <jgallagher@gso.uri.edu>
Packit a4aae4
Packit a4aae4
// TestByte is a demonstration of subclassing a class in the hierarchy of
Packit a4aae4
// DODS data types. It does not do much of anything - a real subclass would
Packit a4aae4
// add specifics for an API or format (e.g., a read mfunc for netcdf, HDF,
Packit a4aae4
// ...).  The class is used by some of the test code (hence the name) as well
Packit a4aae4
// as serving as a template for others who need to subclass the hierarchy.
Packit a4aae4
//
Packit a4aae4
// Since the class Byte is an abstract class (as are all the other
Packit a4aae4
// `variable type' classes), the hierarchy *must* be subclassed in order to
Packit a4aae4
// be used.
Packit a4aae4
//
Packit a4aae4
// jhrg 1/12/95
Packit a4aae4
//
Packit a4aae4
// NB: It is no longer true that Byte, ..., Grid are abstract classes. They
Packit a4aae4
// are now concrete ad do not necessarily need to be subclassed. 01/22/03 jhrg
Packit a4aae4
Packit a4aae4
#ifndef _testbyte_h
Packit a4aae4
#define _testbyte_h 1
Packit a4aae4
Packit a4aae4
#include "Byte.h"
Packit a4aae4
#include "TestCommon.h"
Packit a4aae4
Packit a4aae4
using namespace libdap ;
Packit a4aae4
Packit a4aae4
class TestByte: public Byte, public TestCommon {
Packit a4aae4
    bool d_series_values;
Packit a4aae4
    void _duplicate(const TestByte &ts);
Packit a4aae4
Packit a4aae4
public:
Packit a4aae4
    TestByte(const string &n);
Packit a4aae4
    TestByte(const string &n, const string &d);
Packit a4aae4
    TestByte(const TestByte &rhs;;
Packit a4aae4
Packit a4aae4
    virtual ~TestByte() {}
Packit a4aae4
Packit a4aae4
    TestByte &operator=(const TestByte &rhs;;
Packit a4aae4
Packit a4aae4
    virtual BaseType *ptr_duplicate();
Packit a4aae4
Packit a4aae4
    virtual bool read();
Packit a4aae4
Packit a4aae4
    virtual void output_values(std::ostream &out;;
Packit a4aae4
Packit a4aae4
    virtual void set_series_values(bool sv) { d_series_values = sv; }
Packit a4aae4
    virtual bool get_series_values() { return d_series_values; }
Packit a4aae4
};
Packit a4aae4
Packit a4aae4
#endif // _testbyte_h
Packit a4aae4