/usr/include/crystalspace-2.0/csutil/csobject.h is in libcrystalspace-dev 2.0+dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | /*
Copyright (C) 1998-2001 by Jorrit Tyberghein
csObject library (C) 1999 by Ivan Avramovic <ivan@avramovic.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __CS_CSOBJECT_H__
#define __CS_CSOBJECT_H__
/**\file
* Implementation for iObject
*/
#include "csextern.h"
#include "csutil/leakguard.h"
#include "csutil/refarr.h"
#include "csutil/refcount.h"
#include "csutil/scf_implementation.h"
#include "iutil/object.h"
typedef csRefArray<iObject> csObjectContainer;
#include "csutil/deprecated_warn_off.h"
/**
* A generic csObject class. Any csObject can have any number of iObject
* children attached to it. You can use scfQueryInterface to get interfaces
* from the child objects.
*/
class CS_CRYSTALSPACE_EXPORT csObject :
public scfImplementation1<csObject, iObject>,
public CS::Utility::InternalRefCount
{
protected:
friend class csObjectIterator;
/// Each object has a unique ID associated with it
uint csid;
/// The array of child nodes
csObjectContainer *Children;
/// Object's name or 0 if unnamed.
char *Name;
/// Parent object
iObject *ParentObject;
/// Name change listeners.
csRefArray<iObjectNameChangeListener> listeners;
/// Private initialization function
void InitializeObject ();
/// Fire name change listeners.
void FireNameChangeListeners (const char* oldname, const char* newname);
public:
CS_LEAKGUARD_DECLARE (csObject);
/// Initialize the csObject.
csObject (iBase* pParent = 0);
/**
* Copy constructor. The copied object contains all children of the original
* object, but has a new ID and is not automatically added to the original
* object's parent.
*/
csObject (csObject &o);
/// Destroy this object and the associated children
virtual ~csObject ();
/// Set object name
virtual void SetName (const char *iName);
/// Query object name
virtual const char *GetName () const;
/// Get the unique ID associated with this object
virtual uint GetID () const;
/// Set the parent csObject.
virtual void SetObjectParent (iObject *);
/// Returns the parent iObject.
virtual iObject* GetObjectParent () const;
/// Attach a new iObject to the tree
virtual void ObjAdd (iObject *obj);
/// Deletes the given object, removing it from the object tree
virtual void ObjRemove (iObject *obj);
/// Deletes all objects, removing them from the object tree
virtual void ObjRemoveAll ();
/// Add all child objects of the given object
virtual void ObjAddChildren (iObject *Parent);
/**
* Look for a child object that implements the given interface. You can
* optionally pass a name to look for. If FirstName is true then the
* method will stop at the first object with the requested name, even
* if it did not implement the requested type. Note that the returned
* object must still be queried for the requested type. <p>
*
* Note that the returned object will be IncRef'ed.
*/
virtual iObject* GetChild (int iInterfaceID, int iVersion,
const char *Name, bool FirstName) const;
/// Return the first child object with the given name
virtual iObject *GetChild (const char *Name) const;
/**
* Return an iterator for all child objects. Note that you should not
* remove child objects while iterating.
*/
virtual csPtr<iObjectIterator> GetIterator ();
virtual void AddNameChangeListener (
iObjectNameChangeListener* listener);
virtual void RemoveNameChangeListener (
iObjectNameChangeListener* listener);
virtual void ObjReleaseOld (iObject *obj);
virtual iObject* GetChild (int iInterfaceID, int iVersion,
const char *Name = 0) const;
};
#include "csutil/deprecated_warn_on.h"
#endif // __CS_CSOBJECT_H__
|