home *** CD-ROM | disk | FTP | other *** search
- #ifndef _ICUST_
- #define _ICUST_
- /*******************************************************************************
- * FILE NAME: icust.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * ICustomer - IBM sample customer part. *
- * *
- * COPYRIGHT: *
- * IBM(R) VisualAge(TM) for C++ *
- * (C) Copyright International Business Machines Corporation 1991, 1996 *
- * Licensed Material - Program-Property of IBM - All Rights Reserved. *
- * US Government Users Restricted Rights - Use, duplication, or disclosure *
- * restricted by GSA ADP Schedule Contract with IBM Corp. *
- * *
- * This program will not run in DOS mode. *
- * *
- * DISCLAIMER OF WARRANTIES: *
- * The following [enclosed] code is sample code created by IBM *
- * Corporation. This sample code is not part of any standard IBM product *
- * and is provided to you solely for the purpose of assisting you in the *
- * development of your applications. The code is provided "AS IS", *
- * without warranty of any kind. IBM shall not be liable for any damages *
- * arising out of your use of the sample code, even if they have been *
- * advised of the possibility of such damages. *
- *******************************************************************************/
- #ifndef _IVBDEFS__
- #include <ivbdefs.h>
- #endif
-
- #ifndef _ISTDNTFY_
- #include <istdntfy.hpp>
- #endif
-
- #ifndef _ISTRING_
- #include <istring.hpp>
- #endif
-
- #ifndef _IDATE_
- #include <idate.hpp>
- #endif
-
- #ifndef _ITIME_
- #include <itime.hpp>
- #endif
-
- #ifndef _IPTR_H
- #include <iptr.h>
- #endif
-
- class IAddress;
-
- /*-------------------------- Pragma Library Support --------------------------*/
- #ifndef __NO_DEFAULT_LIBS__
- #ifdef __OS2__
- #ifdef __IMPORTLIB__
- #pragma library("CPPOV03I.LIB")
- #else
- #pragma library("CPPOV03.LIB")
- #endif
- #endif
- #ifdef __WINDOWS__
- #ifdef __IMPORTLIB__
- #pragma library("CPPWV03I.LIB")
- #else
- #pragma library("CPPWV03.LIB")
- #endif
- #endif
- #endif
-
- class ICustomer;
-
- typedef IElemPointer<ICustomer>
- ICustomerElemPtr;
-
- typedef IMngElemPointer<ICustomer>
- ICustomerMngPtr;
-
- /*----------------------------------------------------------------------------*/
- /* Align classes on four byte boundary. */
- /*----------------------------------------------------------------------------*/
- #pragma pack(4)
-
- class ICustomer : public IStandardNotifier
- {
- typedef IStandardNotifier
- Inherited;
- public:
- /*--------------------------- PUBLIC -----------------------------------------*/
-
- /*------------------------- Constructors/Destructor ----------------------------
- ------------------------------------------------------------------------------*/
- ICustomer ();
- ICustomer (const IString& aName);
- ICustomer (const ICustomer& partCopy);
- virtual
- ~ICustomer ();
-
- /*-------------------------------- Operators -----------------------------------
- | operator == - Operator == (return true if equal). |
- | operator != - Operator != (return true if not equal). |
- ------------------------------------------------------------------------------*/
- ICustomer& operator= (const ICustomer& aICustomer);
- Boolean
- operator == (const ICustomer& aValue) const,
- operator != (const ICustomer& aValue) const,
- operator == (const ICustomer* aValue) const,
- operator != (const ICustomer* aValue) const,
- operator < (const ICustomer& aValue) const,
- operator < (const ICustomer* aValue) const,
- operator < (ICustomer* const& aValue) const,
- operator < (ICustomerElemPtr const& aValue) const,
- operator < (ICustomerMngPtr const& aValue) const;
-
- virtual IString
- asString ( ) const;
-
- /*-------------------------------- Attributes ----------------------------------
- | List of query and set members functions for this class: |
- | |
- | name - Query the name (IString) attribute. |
- | address - Query the address (IAddress*) attribute. |
- | homePhone - Query the homePhone (IString) attribute. |
- | workPhone - Query the workPhone (IString) attribute. |
- | date - Query the date (IDate) attribute. |
- | time - Query the time (ITime) attribute. |
- | setName - Set the name (IString) attribute. |
- | setAddress - Set the address (IAddress*) attribute. |
- | setHomePhone - Set the homePhone (IString) attribute. |
- | setWorkPhone - Set the workPhone (IString) attribute. |
- | setDate - Set the date (IDate) attribute. |
- | setTime - Set the time (ITime) attribute. |
- ------------------------------------------------------------------------------*/
-
- virtual IString
- name () const;
- virtual ICustomer
- &setName (const IString& aName);
-
- virtual IAddress*
- address () const;
- virtual ICustomer
- &setAddress (IAddress* aAddress),
- &setAddress (const IAddress& aAddress);
-
- virtual IString
- homePhone () const;
- virtual ICustomer
- &setHomePhone (const IString& aHomePhone);
-
- virtual IString
- workPhone () const;
- virtual ICustomer
- &setWorkPhone (const IString& aWorkPhone);
-
- virtual IDate
- date () const;
- virtual ICustomer
- &setDate (const IDate& aDate);
-
- virtual ITime
- time () const;
- virtual ICustomer
- &setTime (const ITime& aTime);
-
- /*-------------------------------- Actions -------------------------------------
- | List of operations or services provided by this class: |
- | |
- | setNameToDefault - Perform the setNameToDefault action. |
- | setAddressToDefault - Perform the setAddressToDefault action. |
- | setHomePhoneToDefault - Perform the setHomePhoneToDefault action. |
- | setWorkPhoneToDefault - Perform the setWorkPhoneToDefault action. |
- ------------------------------------------------------------------------------*/
- virtual ICustomer
- &setNameToDefault (),
- &setAddressToDefault (),
- &setHomePhoneToDefault (),
- &setWorkPhoneToDefault ();
-
- /*----------------------- Notification Event Descriptions ----------------------
- | List of attribute and event notification identifiers: |
- | |
- | nameId - Notification ID provided to observers when the |
- | name attribute changes. |
- | addressId - Notification ID provided to observers when the |
- | address attribute changes. |
- | homePhoneId - Notification ID provided to observers when the |
- | homePhone attribute changes. |
- | workPhoneId - Notification ID provided to observers when the |
- | workPhone attribute changes. |
- | dateId - Notification ID provided to observers when the |
- | date attribute changes. |
- | timeId - Notification ID provided to observers when the |
- | time attribute changes. |
- ------------------------------------------------------------------------------*/
- static INotificationId const
- IVB_IMPORT nameId,
- IVB_IMPORT addressId,
- IVB_IMPORT homePhoneId,
- IVB_IMPORT workPhoneId,
- IVB_IMPORT dateId,
- IVB_IMPORT timeId;
-
-
- private:
- /*--------------------------- PRIVATE ----------------------------------------*/
- IString iName; //Data member for name attribute
- IAddress* iAddress; //Data member for address attribute
- IString iHomePhone; //Data member for homePhone attribute
- IString iWorkPhone; //Data member for workPhone attribute
- IDate iDate; //Data member for date attribute
- ITime iTime; //Data member for time attribute
- };
-
- /*----------------------------------------------------------------------------*/
- /* Resume compiler default packing. */
- /*----------------------------------------------------------------------------*/
- #pragma pack()
-
- #endif
-