home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
VISBUILD
/
RAPSHEET
/
CPPOV23
/
IALIAS.CPP
< prev
next >
Wrap
Text File
|
1995-05-12
|
5KB
|
121 lines
//****************************************************************************
// IAlias Class - C++ Source File (ialias.cpp) *
// *
// COPYRIGHT: Copyright (C) International Business Machines Corp., 1994,1995 *
// *
// 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. *
//****************************************************************************
//NOTE: WE RECOMMEND USING A FIXED-SPACE FONT TO LOOK AT THE SOURCE.
//
#include "IAlias.hpp"
#ifndef _INOTIFEV_
#include "inotifev.hpp"
#endif
/****************************************************************************
* Constructors
****************************************************************************/
IAlias :: IAlias() :
dAlias("")
{
}
/****************************************************************************
* Destructor
****************************************************************************/
IAlias :: ~IAlias()
{
}
/****************************************************************************
* Events
****************************************************************************/
INotificationId IAlias :: aliasId = "IAlias::alias";
/****************************************************************************
* Attribute Access Member Functions
****************************************************************************/
/*------------------------------------------------------------------
* alias
*-----------------------------------------------------------------*/
IString IAlias :: alias() const
{
return dAlias;
}
IAlias & IAlias ::
setAlias(const IString & iAlias)
{
if (dAlias != iAlias)
{
dAlias = iAlias;
notifyObservers(INotificationEvent(aliasId, *this, true,
IEventData((char *)iAlias)));
}
else
notifyObservers(INotificationEvent(aliasId, *this, false));
return *this;
}
/****************************************************************************
* Action Member Functions
****************************************************************************/
/*------------------------------------------------------------------
* asString()
*-----------------------------------------------------------------*/
IString IAlias :: asString() const
{
return alias();
}
/****************************************************************************
* Operators
****************************************************************************/
/*------------------------------------------------------------------
* Operator == (const IAlias & value)
*-----------------------------------------------------------------*/
Boolean IAlias::operator ==(const IAlias & value) const
{
if (alias() != value.alias()) return false;
return true;
}
/*------------------------------------------------------------------
* Operator == (const IAlias * value)
*-----------------------------------------------------------------*/
Boolean IAlias::operator == (const IAlias * value) const
{
if (alias() != value->alias()) return false;
return true;
}
/*------------------------------------------------------------------
* Operator != (const IAlias & value)
*-----------------------------------------------------------------*/
Boolean IAlias::operator != (const IAlias & value) const
{
if (alias() != value.alias()) return true;
return false;
}
/*------------------------------------------------------------------
* Operator != (const IAlias * value)
*-----------------------------------------------------------------*/
Boolean IAlias::operator != (const IAlias * value) const
{
if (alias() != value->alias()) return true;
return false;
}