/*
 * Copyright (c) 1999 Johnny C. Lam.
 * All rights reserved.
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  The author makes no representations
 * about the suitability of this software for any purpose.  It is
 * provided "as is" without express or implied warranty.
 */

// -*- C++ -*-

#ifndef MARKER_H_INCLUDED
#define MARKER_H_INCLUDED

#ifndef IOSFWD_INCLUDED
#include <iosfwd>
#define IOSFWD_INCLUDED
#endif

///////////////////////////////////////////////////////////////////////////
//
// Marker
//
// Interface and implementation of marker datatype, which can 
// contain positive integers or NA.
//
///////////////////////////////////////////////////////////////////////////

class Marker {
public:
    static const int NA = -1;
    Marker(int = NA);
    
public:
    bool	IsNA() const;
    int		Value() const;
    
    static unsigned int	diff(Marker, Marker);
    
    // Arithmetic operators.
    Marker &	operator+=(unsigned int i);
    Marker &	operator-=(unsigned int i);
    
    // Read from streams.
    void	Read(istream&);

private:
    int _marker;
};

bool		operator==(Marker, Marker);
bool		operator<(Marker, Marker);
ostream&	operator<<(ostream&, Marker);
istream&	operator>>(istream&, Marker&);

#include "marker_inline.h"

#endif /* MARKER_H_INCLUDED */
