/* $Id$
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
 *
 *  This software/database is a "United States Government Work" under the
 *  terms of the United States Copyright Act.  It was written as part of
 *  the author's official duties as a United States Government employee and
 *  thus cannot be copyrighted.  This software/database is freely available
 *  to the public for use. The National Library of Medicine and the U.S.
 *  Government have not placed any restriction on its use or reproduction.
 *
 *  Although all reasonable efforts have been taken to ensure the accuracy
 *  and reliability of the software and data, the NLM and the U.S.
 *  Government do not and cannot warrant the performance or results that
 *  may be obtained by using this software or data. The NLM and the U.S.
 *  Government disclaim all warranties, express or implied, including
 *  warranties of performance, merchantability or fitness for any particular
 *  purpose.
 *
 *  Please cite the author in any work or product based on this material.
 *
 * ===========================================================================
 *
 */

/// @file Date_std_.hpp
/// Data storage class.
///
/// This file was generated by application DATATOOL
/// using the following specifications:
/// 'general.asn'.
///
/// ATTENTION:
///   Don't edit or commit this file into CVS as this file will
///   be overridden (by DATATOOL) without warning!

#ifndef OBJECTS_GENERAL_DATE_STD_BASE_HPP
#define OBJECTS_GENERAL_DATE_STD_BASE_HPP

// standard includes
#include <serial/serialbase.hpp>

// generated includes
#include <string>

BEGIN_NCBI_SCOPE

#ifndef BEGIN_objects_SCOPE
#  define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
#  define END_objects_SCOPE END_SCOPE(objects)
#endif
BEGIN_objects_SCOPE // namespace ncbi::objects::


// generated classes

/////////////////////////////////////////////////////////////////////////////
/// NOTE: this is NOT a unix tm struct
class NCBI_GENERAL_EXPORT CDate_std_Base : public CSerialObject
{
    typedef CSerialObject Tparent;
public:
    // constructor
    CDate_std_Base(void);
    // destructor
    virtual ~CDate_std_Base(void);

    // type info
    DECLARE_INTERNAL_TYPE_INFO();

    // types
    typedef int TYear;
    typedef int TMonth;
    typedef int TDay;
    typedef string TSeason;
    typedef int THour;
    typedef int TMinute;
    typedef int TSecond;

    // member index
    enum class E_memberIndex {
        e__allMandatory = 0,
        e_year,
        e_month,
        e_day,
        e_season,
        e_hour,
        e_minute,
        e_second
    };
    typedef Tparent::CMemberIndex<E_memberIndex, 8> TmemberIndex;

    // getters
    // setters

    /// full year (including 1900)
    /// mandatory
    /// typedef int TYear
    ///  Check whether the Year data member has been assigned a value.
    bool IsSetYear(void) const;
    /// Check whether it is safe or not to call GetYear method.
    bool CanGetYear(void) const;
    void ResetYear(void);
    TYear GetYear(void) const;
    void SetYear(TYear value);
    TYear& SetYear(void);

    /// month (1-12)
    /// optional
    /// typedef int TMonth
    ///  Check whether the Month data member has been assigned a value.
    bool IsSetMonth(void) const;
    /// Check whether it is safe or not to call GetMonth method.
    bool CanGetMonth(void) const;
    void ResetMonth(void);
    TMonth GetMonth(void) const;
    void SetMonth(TMonth value);
    TMonth& SetMonth(void);

    /// day of month (1-31)
    /// optional
    /// typedef int TDay
    ///  Check whether the Day data member has been assigned a value.
    bool IsSetDay(void) const;
    /// Check whether it is safe or not to call GetDay method.
    bool CanGetDay(void) const;
    void ResetDay(void);
    TDay GetDay(void) const;
    void SetDay(TDay value);
    TDay& SetDay(void);

    /// for "spring", "may-june", etc
    /// optional
    /// typedef string TSeason
    ///  Check whether the Season data member has been assigned a value.
    bool IsSetSeason(void) const;
    /// Check whether it is safe or not to call GetSeason method.
    bool CanGetSeason(void) const;
    void ResetSeason(void);
    const TSeason& GetSeason(void) const;
    void SetSeason(const TSeason& value);
    void SetSeason(TSeason&& value);
    TSeason& SetSeason(void);

    /// hour of day (0-23)
    /// optional
    /// typedef int THour
    ///  Check whether the Hour data member has been assigned a value.
    bool IsSetHour(void) const;
    /// Check whether it is safe or not to call GetHour method.
    bool CanGetHour(void) const;
    void ResetHour(void);
    THour GetHour(void) const;
    void SetHour(THour value);
    THour& SetHour(void);

    /// minute of hour (0-59)
    /// optional
    /// typedef int TMinute
    ///  Check whether the Minute data member has been assigned a value.
    bool IsSetMinute(void) const;
    /// Check whether it is safe or not to call GetMinute method.
    bool CanGetMinute(void) const;
    void ResetMinute(void);
    TMinute GetMinute(void) const;
    void SetMinute(TMinute value);
    TMinute& SetMinute(void);

    /// second of minute (0-59)
    /// optional
    /// typedef int TSecond
    ///  Check whether the Second data member has been assigned a value.
    bool IsSetSecond(void) const;
    /// Check whether it is safe or not to call GetSecond method.
    bool CanGetSecond(void) const;
    void ResetSecond(void);
    TSecond GetSecond(void) const;
    void SetSecond(TSecond value);
    TSecond& SetSecond(void);

    /// Reset the whole object
    virtual void Reset(void);


private:
    // Prohibit copy constructor and assignment operator
    CDate_std_Base(const CDate_std_Base&);
    CDate_std_Base& operator=(const CDate_std_Base&);

    // data
    Uint4 m_set_State[1];
    int m_Year;
    int m_Month;
    int m_Day;
    string m_Season;
    int m_Hour;
    int m_Minute;
    int m_Second;
};






///////////////////////////////////////////////////////////
///////////////////// inline methods //////////////////////
///////////////////////////////////////////////////////////
inline
bool CDate_std_Base::IsSetYear(void) const
{
    return ((m_set_State[0] & 0x3) != 0);
}

inline
bool CDate_std_Base::CanGetYear(void) const
{
    return IsSetYear();
}

inline
void CDate_std_Base::ResetYear(void)
{
    m_Year = 0;
    m_set_State[0] &= ~0x3;
}

inline
CDate_std_Base::TYear CDate_std_Base::GetYear(void) const
{
    if (!CanGetYear()) {
        ThrowUnassigned(0);
    }
    return m_Year;
}

inline
void CDate_std_Base::SetYear(CDate_std_Base::TYear value)
{
    m_Year = value;
    m_set_State[0] |= 0x3;
}

inline
CDate_std_Base::TYear& CDate_std_Base::SetYear(void)
{
#ifdef _DEBUG
    if (!IsSetYear()) {
        memset(&m_Year,UnassignedByte(),sizeof(m_Year));
    }
#endif
    m_set_State[0] |= 0x1;
    return m_Year;
}

inline
bool CDate_std_Base::IsSetMonth(void) const
{
    return ((m_set_State[0] & 0xc) != 0);
}

inline
bool CDate_std_Base::CanGetMonth(void) const
{
    return IsSetMonth();
}

inline
void CDate_std_Base::ResetMonth(void)
{
    m_Month = 0;
    m_set_State[0] &= ~0xc;
}

inline
CDate_std_Base::TMonth CDate_std_Base::GetMonth(void) const
{
    if (!CanGetMonth()) {
        ThrowUnassigned(1);
    }
    return m_Month;
}

inline
void CDate_std_Base::SetMonth(CDate_std_Base::TMonth value)
{
    m_Month = value;
    m_set_State[0] |= 0xc;
}

inline
CDate_std_Base::TMonth& CDate_std_Base::SetMonth(void)
{
#ifdef _DEBUG
    if (!IsSetMonth()) {
        memset(&m_Month,UnassignedByte(),sizeof(m_Month));
    }
#endif
    m_set_State[0] |= 0x4;
    return m_Month;
}

inline
bool CDate_std_Base::IsSetDay(void) const
{
    return ((m_set_State[0] & 0x30) != 0);
}

inline
bool CDate_std_Base::CanGetDay(void) const
{
    return IsSetDay();
}

inline
void CDate_std_Base::ResetDay(void)
{
    m_Day = 0;
    m_set_State[0] &= ~0x30;
}

inline
CDate_std_Base::TDay CDate_std_Base::GetDay(void) const
{
    if (!CanGetDay()) {
        ThrowUnassigned(2);
    }
    return m_Day;
}

inline
void CDate_std_Base::SetDay(CDate_std_Base::TDay value)
{
    m_Day = value;
    m_set_State[0] |= 0x30;
}

inline
CDate_std_Base::TDay& CDate_std_Base::SetDay(void)
{
#ifdef _DEBUG
    if (!IsSetDay()) {
        memset(&m_Day,UnassignedByte(),sizeof(m_Day));
    }
#endif
    m_set_State[0] |= 0x10;
    return m_Day;
}

inline
bool CDate_std_Base::IsSetSeason(void) const
{
    return ((m_set_State[0] & 0xc0) != 0);
}

inline
bool CDate_std_Base::CanGetSeason(void) const
{
    return IsSetSeason();
}

inline
const CDate_std_Base::TSeason& CDate_std_Base::GetSeason(void) const
{
    if (!CanGetSeason()) {
        ThrowUnassigned(3);
    }
    return m_Season;
}

inline
void CDate_std_Base::SetSeason(const CDate_std_Base::TSeason& value)
{
    m_Season = value;
    m_set_State[0] |= 0xc0;
}

inline
void CDate_std_Base::SetSeason(CDate_std_Base::TSeason&& value)
{
    m_Season = std::forward<CDate_std_Base::TSeason>(value);
    m_set_State[0] |= 0xc0;
}

inline
CDate_std_Base::TSeason& CDate_std_Base::SetSeason(void)
{
#ifdef _DEBUG
    if (!IsSetSeason()) {
        m_Season = UnassignedString();
    }
#endif
    m_set_State[0] |= 0x40;
    return m_Season;
}

inline
bool CDate_std_Base::IsSetHour(void) const
{
    return ((m_set_State[0] & 0x300) != 0);
}

inline
bool CDate_std_Base::CanGetHour(void) const
{
    return IsSetHour();
}

inline
void CDate_std_Base::ResetHour(void)
{
    m_Hour = 0;
    m_set_State[0] &= ~0x300;
}

inline
CDate_std_Base::THour CDate_std_Base::GetHour(void) const
{
    if (!CanGetHour()) {
        ThrowUnassigned(4);
    }
    return m_Hour;
}

inline
void CDate_std_Base::SetHour(CDate_std_Base::THour value)
{
    m_Hour = value;
    m_set_State[0] |= 0x300;
}

inline
CDate_std_Base::THour& CDate_std_Base::SetHour(void)
{
#ifdef _DEBUG
    if (!IsSetHour()) {
        memset(&m_Hour,UnassignedByte(),sizeof(m_Hour));
    }
#endif
    m_set_State[0] |= 0x100;
    return m_Hour;
}

inline
bool CDate_std_Base::IsSetMinute(void) const
{
    return ((m_set_State[0] & 0xc00) != 0);
}

inline
bool CDate_std_Base::CanGetMinute(void) const
{
    return IsSetMinute();
}

inline
void CDate_std_Base::ResetMinute(void)
{
    m_Minute = 0;
    m_set_State[0] &= ~0xc00;
}

inline
CDate_std_Base::TMinute CDate_std_Base::GetMinute(void) const
{
    if (!CanGetMinute()) {
        ThrowUnassigned(5);
    }
    return m_Minute;
}

inline
void CDate_std_Base::SetMinute(CDate_std_Base::TMinute value)
{
    m_Minute = value;
    m_set_State[0] |= 0xc00;
}

inline
CDate_std_Base::TMinute& CDate_std_Base::SetMinute(void)
{
#ifdef _DEBUG
    if (!IsSetMinute()) {
        memset(&m_Minute,UnassignedByte(),sizeof(m_Minute));
    }
#endif
    m_set_State[0] |= 0x400;
    return m_Minute;
}

inline
bool CDate_std_Base::IsSetSecond(void) const
{
    return ((m_set_State[0] & 0x3000) != 0);
}

inline
bool CDate_std_Base::CanGetSecond(void) const
{
    return IsSetSecond();
}

inline
void CDate_std_Base::ResetSecond(void)
{
    m_Second = 0;
    m_set_State[0] &= ~0x3000;
}

inline
CDate_std_Base::TSecond CDate_std_Base::GetSecond(void) const
{
    if (!CanGetSecond()) {
        ThrowUnassigned(6);
    }
    return m_Second;
}

inline
void CDate_std_Base::SetSecond(CDate_std_Base::TSecond value)
{
    m_Second = value;
    m_set_State[0] |= 0x3000;
}

inline
CDate_std_Base::TSecond& CDate_std_Base::SetSecond(void)
{
#ifdef _DEBUG
    if (!IsSetSecond()) {
        memset(&m_Second,UnassignedByte(),sizeof(m_Second));
    }
#endif
    m_set_State[0] |= 0x1000;
    return m_Second;
}

///////////////////////////////////////////////////////////
////////////////// end of inline methods //////////////////
///////////////////////////////////////////////////////////





END_objects_SCOPE // namespace ncbi::objects::

END_NCBI_SCOPE


#endif // OBJECTS_GENERAL_DATE_STD_BASE_HPP
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208
0209
0210
0211
0212
0213
0214
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237
0238
0239
0240
0241
0242
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252
0253
0254
0255
0256
0257
0258
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268
0269
0270
0271
0272
0273
0274
0275
0276
0277
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291
0292
0293
0294
0295
0296
0297
0298
0299
0300
0301
0302
0303
0304
0305
0306
0307
0308
0309
0310
0311
0312
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329
0330
0331
0332
0333
0334
0335
0336
0337
0338
0339
0340
0341
0342
0343
0344
0345
0346
0347
0348
0349
0350
0351
0352
0353
0354
0355
0356
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380
0381
0382
0383
0384
0385
0386
0387
0388
0389
0390
0391
0392
0393
0394
0395
0396
0397
0398
0399
0400
0401
0402
0403
0404
0405
0406
0407
0408
0409
0410
0411
0412
0413
0414
0415
0416
0417
0418
0419
0420
0421
0422
0423
0424
0425
0426
0427
0428
0429
0430
0431
0432
0433
0434
0435
0436
0437
0438
0439
0440
0441
0442
0443
0444
0445
0446
0447
0448
0449
0450
0451
0452
0453
0454
0455
0456
0457
0458
0459
0460
0461
0462
0463
0464
0465
0466
0467
0468
0469
0470
0471
0472
0473
0474
0475
0476
0477
0478
0479
0480
0481
0482
0483
0484
0485
0486
0487
0488
0489
0490
0491
0492
0493
0494
0495
0496
0497
0498
0499
0500
0501
0502
0503
0504
0505
0506
0507
0508
0509
0510
0511
0512
0513
0514
0515
0516
0517
0518
0519
0520
0521
0522
0523
0524
0525
0526
0527
0528
0529
0530
0531
0532
0533
0534
0535
0536
0537
0538
0539
0540
0541
0542
0543
0544
0545
0546
0547
0548
0549
0550
0551
0552
0553

-