[ogs-changes] dist/c++/ogs/support Attachable.h,NONE,1.1 Class.cpp,1.1,1.2 Event.cpp,1.1,1.2 Event.h
Status: Alpha
Brought to you by:
elemings
From: <ele...@us...> - 2003-03-25 06:13:18
|
Update of /cvsroot/ogs/dist/c++/ogs/support In directory sc8-pr-cvs1:/tmp/cvs-serv1939/c++/ogs/support Modified Files: Class.cpp Event.cpp Event.h Object.cpp Added Files: Attachable.h Log Message: See C++ ChangeLog file (Mar 24) for details. --- NEW FILE: Attachable.h --- /* * Attachable.java -- class declaration for attachable objects * Copyright (C) 2003 Eric Lemings <ele...@us...> * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA * * RCS: $Id: Attachable.h,v 1.1 2003/03/25 06:13:15 elemings Exp $ */ #ifdef __cplusplus # ifndef OGS_SUPPORT_ATTACHABLE_H # define OGS_SUPPORT_ATTACHABLE_H # include <ogs/support/Namespace.h> OGS_BEGIN_SUPPORT_NAMESPACE class Object; /** * An object that can be attached to another object. While attached, a * attachable may modify the object that it is attached to. These * modifications should be reversible if and when the attachable is * detached from the object. */ class Attachable { public: /** * Attach this attachable to an object. This function first * determines whether this object can be attached to the specified * object. This step usually checks whether the object is being * attached to itself or whether it is already attached. If the * object can be attached, this function then applies any * modifications to the attached object and returns true. * Otherwise, this function should simply return false. * * @param object Object to attach this attachable to. * @return True if this attachable is attached to the object. */ virtual bool attachObject (Object& object) = 0; /** * Detach this attachable from an object. This function determines * if this object is attached and, if so, whether it can be detached * from the attached object. If it can, the function removes or * otherwise reverses any modifications made to the attached object * and returns true. Otherwise, the function returns false. * * @return True if this attachable is detached from the object. */ virtual bool detachObject () = 0; /** * Determine the object that this attachable is currently attached * to. If the attachable is not currently attached to any object, * this function returns null. * * @return Attached object or null if not attached. */ virtual Object* getObject () const = 0; }; OGS_END_SUPPORT_NAMESPACE # endif /* !defined OGS_SUPPORT_ATTACHABLE_H */ #endif /* defined __cplusplus */ Index: Class.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/support/Class.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Class.cpp 7 Jan 2003 07:41:34 -0000 1.1 --- Class.cpp 25 Mar 2003 06:13:15 -0000 1.2 *************** *** 21,25 **** */ ! #include "Class.h" using ogs::support::Class; --- 21,25 ---- */ ! #include "ogs/support/Class.h" using ogs::support::Class; Index: Event.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/support/Event.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Event.cpp 7 Jan 2003 07:41:34 -0000 1.1 --- Event.cpp 25 Mar 2003 06:13:15 -0000 1.2 *************** *** 24,33 **** #include <string> ! #include "Object.h" ! #include "Event.h" using ogs::support::Event; - - Event::~Event () { } /** --- 24,31 ---- #include <string> ! #include "ogs/support/Object.h" ! #include "ogs/support/Event.h" using ogs::support::Event; /** Index: Event.h =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/support/Event.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Event.h 7 Jan 2003 07:41:34 -0000 1.1 --- Event.h 25 Mar 2003 06:13:15 -0000 1.2 *************** *** 71,74 **** --- 71,76 ---- } + inline Event::~Event () { } + OGS_END_SUPPORT_NAMESPACE Index: Object.cpp =================================================================== RCS file: /cvsroot/ogs/dist/c++/ogs/support/Object.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Object.cpp 18 Feb 2003 04:17:21 -0000 1.2 --- Object.cpp 25 Mar 2003 06:13:15 -0000 1.3 *************** *** 26,32 **** #include <typeinfo> ! #include "Class.h" ! #include "Object.h" ! #include "Observer.h" using namespace ogs::support; --- 26,32 ---- #include <typeinfo> ! #include "ogs/support/Class.h" ! #include "ogs/support/Object.h" ! #include "ogs/support/Observer.h" using namespace ogs::support; |