[ogs-changes] dist/c++/ogs/support Event.cpp,1.2,1.3 Event.h,1.2,1.3
Status: Alpha
Brought to you by:
elemings
|
From: <ele...@us...> - 2003-04-08 21:43:48
|
Update of /cvsroot/ogs/dist/c++/ogs/support
In directory sc8-pr-cvs1:/tmp/cvs-serv21226/c++/ogs/support
Modified Files:
Event.cpp Event.h
Log Message:
See C++ ChangeLog (Apr 5 and 8) for details.
Index: Event.cpp
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/support/Event.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Event.cpp 25 Mar 2003 06:13:15 -0000 1.2
--- Event.cpp 8 Apr 2003 21:43:13 -0000 1.3
***************
*** 1,4 ****
/*
! * Event.c++ -- class implementation for events
* Copyright (C) 2002 Eric Lemings <ele...@us...>
*
--- 1,4 ----
/*
! * Event.cpp -- class implementation for events
* Copyright (C) 2002 Eric Lemings <ele...@us...>
*
***************
*** 40,44 ****
std::ostringstream ostr;
ostr << (typeid (*this)).name () << "@" << this;
! ostr << " [source " << &source<< "]";
return (ostr.str ());
}
--- 40,44 ----
std::ostringstream ostr;
ostr << (typeid (*this)).name () << "@" << this;
! ostr << " [source " << &(this->_source) << "]";
return (ostr.str ());
}
Index: Event.h
===================================================================
RCS file: /cvsroot/ogs/dist/c++/ogs/support/Event.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Event.h 25 Mar 2003 06:13:15 -0000 1.2
--- Event.h 8 Apr 2003 21:43:14 -0000 1.3
***************
*** 35,48 ****
/**
! * Base class for events. This class provides part of the
! * @em Observer pattern: it provides Observers with the details of
! * the event from Observed objects. The details contained in this class
! * provide observers with a pointer to the observed object. Subclasses
! * can extend this class if additional information is needed.
*/
class Event {
public:
Event (Object& object);
! virtual ~Event ();
Object& getSource () const;
--- 35,49 ----
/**
! * An object that notifies observers of significant events. Events are
! * collaborators in the @em Observer pattern: they provide observers
! * with details of the event from observed objects. An observed object
! * is also called an event source. The details contained in an event
! * provide observers with the source of the event. Derived classes can
! * extend this class to provide additional information if needed.
*/
class Event {
public:
Event (Object& object);
! virtual ~Event () { }
Object& getSource () const;
***************
*** 50,54 ****
private:
! Object& source;
};
--- 51,60 ----
private:
! /*
! * The lifetime of the source is assumed to outlast the lifetime of
! * events that it creates. If this assumption proves false, the
! * source type and perhaps the interface will have to be changed.
! */
! Object& _source;
};
***************
*** 58,62 ****
* @param object The object causing this event.
*/
! inline Event::Event (Object& object): source (object) {
// empty constructor
}
--- 64,69 ----
* @param object The object causing this event.
*/
! inline Event::Event (Object& object):
! _source (object) {
// empty constructor
}
***************
*** 67,75 ****
* @return The object causing this event.
*/
! inline Object& Event::getSource () const {
! return (this->source);
}
-
- inline Event::~Event () { }
OGS_END_SUPPORT_NAMESPACE
--- 74,81 ----
* @return The object causing this event.
*/
! inline Object&
! Event::getSource () const {
! return (this->_source);
}
OGS_END_SUPPORT_NAMESPACE
|