home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
VISBUILD
/
CALCULAT
/
CPPOV13
/
ICALCOP.CPP
< prev
next >
Wrap
Text File
|
1995-04-14
|
2KB
|
65 lines
//****************************************************************************
// ICalcOperator Class - C++ Code File (icalcop.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.
//
// VERSION 2
//
// Changes:
// 9/23/94 - Returns a result as well as having a connectable attribute.
// This allows the result to be gotten via two different types
// of connections as well as allowing for exception handling.
//****************************************************************************
#include "icalcop.hpp" //ICalcOperator class header
#include <inotifev.hpp>
//
// Events
//
INotificationId ICalcOperator :: resultId = "ICalcOperator::result";
/*******************************************************************
* Constructors/Destructors
*******************************************************************/
ICalcOperator :: ICalcOperator() :
dResult(0)
{
}
ICalcOperator :: ~ICalcOperator()
{
}
/*******************************************************************
* Access Member Functions (no Event for dResult)
*******************************************************************/
double ICalcOperator :: result () const
{
return dResult;
}
double ICalcOperator :: setResult
(double iResult)
{
dResult = iResult;
notifyObservers(INotificationEvent(resultId,*this));
return dResult;
}