/usr/include/ossim/base/ossimConnectableContainer.h is in libossim-dev 1.7.21-4.
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 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | //*******************************************************************
// Copyright (C) 2000 ImageLinks Inc.
//
// License: See top level LICENSE.txt file.
//
// Author: Garrett Potts
//
//*************************************************************************
// $Id: ossimConnectableContainer.h 13017 2008-06-10 16:09:17Z dburken $
#ifndef ossimConnectableContainer_HEADER
#define ossimConnectableContainer_HEADER
#include <map>
#include <ossim/base/ossimConstants.h>
#include <ossim/base/ossimConnectableObject.h>
#include <ossim/base/ossimConnectableObjectListener.h>
#include <ossim/base/ossimConnectableContainerInterface.h>
class OSSIMDLLEXPORT ossimConnectableContainerChildListener;
class OSSIMDLLEXPORT ossimConnectableContainer : public ossimConnectableObject,
public ossimConnectableContainerInterface,
public ossimConnectableObjectListener
{
public:
typedef std::map<ossim_int64,
ossimConnectableObject*> connectablObjectMapType;
ossimConnectableContainer(ossimConnectableObject* owner=0);
virtual ~ossimConnectableContainer();
virtual ossimObject* getObject();
virtual const ossimObject* getObject()const;
/**
* @param index Index of object to get.
*
* @see getNumberOfObjects(false) to get the number of objects inside
* the container.
*
* @return Container's object at that index or NULL if out of range.
*
* @note This does not recurse into other containers.
*/
virtual ossimConnectableObject* getConnectableObject(ossim_uint32 index);
/*!
* Will find all objects of the past in type. Use the RTTI type info.
* An optional recurse flag will say if there is another container then
* recurse it to find the type you are looking for else it just looks
* within its immediate children.
*
* Example: passing STATIC_TYPE_INFO(ossimImageRenderer) as an argument will
* look for all ossimImageRenderer's and return the list.
*/
virtual std::vector<ossimConnectableObject*> findAllObjectsOfType(const RTTItypeid& typeInfo,
bool recurse=true);
virtual std::vector<ossimConnectableObject*> findAllObjectsOfType(const ossimString& className,
bool recurse=true);
/*!
* Will find the firt object of the past in type. Use the RTTI type info.
* An optional recurse flag will say if there is another container then
* recurse it to find the type you are looking for else it just looks
* within its immediate children.
*
* Example: passing STATIC_TYPE_INFO(ossimImageRenderer) as an argument will
* look for the first ossimImageRenderer and return that object.
*/
virtual ossimConnectableObject* findFirstObjectOfType(const RTTItypeid& typeInfo,
bool recurse=true);
virtual ossimConnectableObject* findFirstObjectOfType(const ossimString& className,
bool recurse=true);
/*!
* will search for the object given an id. If recurse is true it will
* recurse
* to other containers.
*/
ossimConnectableObject* findObject(const ossimId& id,
bool recurse=true);
ossimConnectableObject* findObject(const ossimConnectableObject* obj,
bool recurse=true);
/*!
* Will cycle through all sources setting their ids. the idLast wlil be
* updated
* so we can recurse into other containers.
*/
void makeUniqueIds();
/*!
* Returns the number of objects within this container and all child
* containers.
*/
ossim_uint32 getNumberOfObjects(bool recurse=true)const;
/*!
* Will add an object to the container and then set the added objects owner
* to this.
*/
virtual bool addChild(ossimConnectableObject* attachableObject);
virtual bool removeChild(ossimConnectableObject* object);
virtual bool canConnectMyInputTo(ossim_int32 index,
const ossimConnectableObject* obj) const;
virtual bool canConnectMyOutputTo(ossim_int32 index,
const ossimConnectableObject* obj) const;
virtual bool loadState(const ossimKeywordlist& kwl,
const char* prefix=0);
virtual bool saveState(ossimKeywordlist& kwl,
const char* prefix=0)const;
//____________________PLACE ALL EVENT HANDLING STUFF HERE_____________
// virtual void objectDestructingEvent(ossimObjectDestructingEvent& event);
// virtual void propertyEvent(ossimPropertyEvent& event);
// virtual void disconnectInputEvent(ossimConnectionEvent& event);
// virtual void connectInputEvent(ossimConnectionEvent& event);
// virtual void disconnectOutputEvent(ossimConnectionEvent& event);
// virtual void connectOutputEvent(ossimConnectionEvent& event);
virtual void getChildren(std::vector<ossimConnectableObject*>& children,
bool immediateChildrenOnlyFlag);
void deleteAllChildren();
// void propagateEventToOutputs(ossimEvent& event,
// ossimConnectableObject* start);
// void propagateEventToInputs(ossimEvent& event,
// ossimConnectableObject* start);
protected:
ossimConnectableContainer(const ossimConnectableContainer& rhs);
void removeAllListeners();
bool addAllObjects(std::map<ossimId, std::vector<ossimId> >& idMapping,
const ossimKeywordlist& kwl,
const char* prefix);
bool connectAllObjects(const std::map<ossimId, std::vector<ossimId> >& idMapping);
void findInputConnectionIds(std::vector<ossimId>& result,
const ossimKeywordlist& kwl,
const char* prefix);
/*!
* Every object added must have a unique id. We will sort them in a easy to
* query form. Since the container can have hundreds of objects we will use a
* more efficient map that allows us to do binary searches of the objects.
*
* map<key, value> The key will be the objectsUnique id and the value
* is a pointer to the attachable object.
*/
connectablObjectMapType theObjectMap;
ossimConnectableContainerChildListener* theChildListener;
TYPE_DATA
};
#endif
|