coherence/io/pof/RawDateTime.hpp

00001 /*
00002 * RawDateTime.hpp
00003 *
00004 * Copyright 2001-2008 by Oracle. All rights reserved.
00005 *
00006 * Oracle is a registered trademarks of Oracle Corporation and/or its
00007 * affiliates.
00008 *
00009 * This software is the confidential and proprietary information of Oracle
00010 * Corporation. You shall not disclose such confidential and proprietary
00011 * information and shall use it only in accordance with the terms of the
00012 * license agreement you entered into with Oracle.
00013 *
00014 * This notice may not be removed or altered.
00015 */
00016 #ifndef COH_RAW_DATE_TIME_HPP
00017 #define COH_RAW_DATE_TIME_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/io/pof/RawDate.hpp"
00022 #include "coherence/io/pof/RawTime.hpp"
00023 
00024 #include <ostream>
00025 
00026 COH_OPEN_NAMESPACE3(coherence,io,pof)
00027 
00028 
00029 /**
00030 * Raw immutable POF date-time value.
00031 *
00032 * @author jh  2008.04.08
00033 */
00034 class COH_EXPORT RawDateTime
00035     : public cloneable_spec<RawDateTime>
00036     {
00037     friend class factory<RawDateTime>;
00038 
00039     // ----- constructors ---------------------------------------------------
00040 
00041     protected:
00042         /**
00043         * Construct a date-time value.
00044         *
00045         * @param vDate  the date portion of the raw date-time value
00046         * @param vTime  the time portion of the raw date-time value
00047         *
00048         * @return the new RawDateTime
00049         */
00050         RawDateTime(RawDate::View vDate, RawTime::View vTime);
00051 
00052         /**
00053         * Copy constructor.
00054         */
00055         RawDateTime(const RawDateTime& that);
00056 
00057 
00058     // ----- Object interface -----------------------------------------------
00059 
00060     public:
00061         /**
00062         * {@inheritDoc}
00063         */
00064         virtual bool equals(Object::View v) const;
00065 
00066         /**
00067         * {@inheritDoc}
00068         */
00069         virtual size32_t hashCode() const;
00070 
00071         /**
00072         * {@inheritDoc}
00073         */
00074         virtual bool isImmutable() const;
00075 
00076         /**
00077         * {@inheritDoc}
00078         */
00079         virtual void toStream(std::ostream &out) const;
00080 
00081 
00082     // ----- accessors ------------------------------------------------------
00083 
00084     public:
00085         /**
00086         * Obtain the date portion of the raw date-time value.
00087         *
00088         * @return the date portion of the raw date-time value
00089         */
00090         virtual RawDate::View getRawDate() const;
00091 
00092         /**
00093         * Obtain the time portion of the raw date-time value.
00094         *
00095         * @return the time portion of the raw date-time value
00096         */
00097         virtual RawTime::View getRawTime() const;
00098 
00099 
00100     // ----- data members ---------------------------------------------------
00101 
00102     protected:
00103         /**
00104         * The date portion of the raw date-time value.
00105         */
00106         const RawDate::View m_vDate;
00107 
00108         /**
00109         * The time portion of the raw date-time value.
00110         */
00111         const RawTime::View m_vTime;
00112     };
00113 
00114 COH_CLOSE_NAMESPACE3
00115 
00116 #endif // COH_RAW_DATE_TIME_HPP
Copyright (c) 2000-2008 Oracle. All rights reserved.