//
// LDASTools frameCPP - A library implementing the LIGO/Virgo frame
// specification
//
// Copyright (C) 2018 California Institute of Technology
//
// LDASTools frameCPP is free software; you may redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 (GPLv2) of the
// License or at your discretion, any later version.
//
// LDASTools frameCPP is distributed in the hope that it will be useful, but
// without any warranty or even the implied warranty of merchantability
// or fitness for a particular purpose. See the GNU General Public
// License (GPLv2) for more details.
//
// Neither the names of the California Institute of Technology (Caltech),
// The Massachusetts Institute of Technology (M.I.T), The Laser
// Interferometer Gravitational-Wave Observatory (LIGO), nor the names
// of its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// You should have received a copy of the licensing terms for this
// software included in the file LICENSE located in the top-level
// directory of this package. If you did not, you can view a copy at
// http://dcc.ligo.org/M1500244/LICENSE
//

#ifndef FrameCPP__UNIVERSAL__FrSH_HH
#define FrameCPP__UNIVERSAL__FrSH_HH

#if !defined( SWIGIMPORTED )
#include "framecpp/Common/FrameSpec.hh"
#include "framecpp/Common/FrSH.hh"
#include "framecpp/Common/TOCInfo.hh"
#endif /* !defined( SWIGIMPORTED ) */

#if !defined( SWIGIMPORTED )
#include "framecpp/Universal/impl/FrameSpec.hh"
#endif /* !defined( SWIGIMPORTED ) */

#include "framecpp/Universal/impl/FrSHClassicIO.hh"
#include "framecpp/Universal/impl/FrSHSerialIO.hh"

namespace FrameCPP
{
    namespace Universal
    {
        //-------------------------------------------------------------------
        /// \brief Contains class information of a dictionary structure.
        ///
        /// A dictionary structure is written to the output stream the
        /// imediately preceeding the first occurance of the frame structure
        /// it describes.
        /// This class gives information about the class structure being
        /// described.
        /// In a dictionary structure, there is only one occurance of FrSH.
        /// It must be the first element of the dictionary structure.
        ///
        /// \see FrSE
        //-------------------------------------------------------------------
        class FrSH
#if !defined( SWIGIMPORTED )
          : public FrSHImpl::ClassicIO< FrSH >,
                     public FrSHImpl::SerialIO< FrSH >,
                     public Common::TOCInfo
#endif /* !defined( SWIGIMPORTED ) */
        {
        public:
            // Bring base class GetDescription methods into scope
            using Common::FrameSpec::Object::GetDescription;
            
            //-----------------------------------------------------------------
            /// \brief Default constructor
            //-----------------------------------------------------------------
            FrSH( );

            //-----------------------------------------------------------------
            /// \brief constructor
            ///
            /// \param[in] Name
            ///     Name of structure being described by this dictionary
            ///     structure.
            /// \param[in] ClassId
            ///     Class number of structure being described
            /// \param[in] Comment
            ///     Comment describing the class.
            //-----------------------------------------------------------------
            FrSH( const name_type&    Name,
                  class_type          ClassId,
                  const comment_type& Comment );

            //-----------------------------------------------------------------
            /// \brief Desctructor
            //-----------------------------------------------------------------
            virtual ~FrSH( );

            //-----------------------------------------------------------------
            /// \brief comparison operator
            //-----------------------------------------------------------------
            virtual bool
            operator==( const Common::FrameSpec::Object& Obj ) const;

            /// Typed equality declared as a hidden friend, not a member, so
            /// it does not pair with the virtual operator==(Object&) override
            /// above under C++20's reversed-candidate rule.
            friend bool
            operator==( const FrSH& LHS, const FrSH& RHS )
            {
                return ( LHS.FrSHImpl::Data::operator==( RHS ) );
            }

            //-----------------------------------------------------------------
            /// \brief Get FrSH/FrSE description of object
            ///
            /// FrSH is a meta-description class, so it returns an empty description
            //-----------------------------------------------------------------
            virtual const Common::Description*
            GetDescription( ) const;

            //-----------------------------------------------------------------
            /// \brief Get FrSH/FrSE description of object for a specific version
            ///
            /// FrSH is a meta-description class, so it returns an empty description
            //-----------------------------------------------------------------
            virtual const Common::Description*
            GetDescription( unsigned int version ) const;

        protected:
#if !WORKING_VIRTUAL_TOCQUERY
            //-----------------------------------------------------------------
            /// \brief Answer requests for information as needed by TOC
            ///
            /// \param[in] InfoClass
            ///     Class of information being requested.
            /// \param[in] vl
            ///     Variable argument list of requested data.
            //-----------------------------------------------------------------
            virtual void vTOCQuery( int InfoClass, va_list vl ) const;
#endif /* ! WORKING_VIRTUAL_TOCQUERY */
        }; // class - FrSH

    } // namespace Universal
} // namespace FrameCPP
#endif /* FrameCPP__UNIVERSAL__FrSH_HH */
