Seid2.h

// Seid2.h
//
// Author David Barrett-Lennard
// (C)opyright Cedanet Pty Ltd 2004

#ifndef Ceda_cxLss_Seid2_H
#define Ceda_cxLss_Seid2_H

#include "cxLss.h"
#include "Ceda/cxUtils/Archive.h"
#include "Seid.h"

namespace ceda
{

class xostream;

#if CEDA_LSS_USE_CONTIGUOUS_SEID_SPACE
    inline bool IsValidSeidPart(SeidPart seidPart)
    {
        return true;
    }
    inline void IncrementSeidPart(SeidPart& seidPart)
    {
        ++seidPart;
    }
#else
    // Tests whether each byte in the seidPart is nonzero
    cxLss_API bool IsValidSeidPart(SeidPart seidPart);

    // Can be used to increment either SeidLow or SeidHigh in a Seid respecting the requirement 
    // that each byte be nonzero.
    cxLss_API void IncrementSeidPart(SeidPart& seidPart);
#endif

cxLss_API xostream& operator<<(xostream& os, Seid seid);

template <typename Archive> 
inline void Serialise(Archive& ar, Seid x)
{
    ar << x.low_ << x.high_;
}

template <typename Archive> 
inline void Deserialise(Archive& ar, Seid& x)
{
    ar >> x.low_ >> x.high_;
}

} // namespace ceda

#endif // include guard