OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimConnectionEvent.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: See top level LICENSE.txt file.
5 //
6 // Author: Garrett Potts
7 //
8 //*************************************************************************
9 // $Id: ossimConnectionEvent.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
10 
12 
13 RTTI_DEF1(ossimConnectionEvent, "ossimConnectionEvent", ossimEvent);
14 
16  :ossimEvent(object, id),
17  theDirectionType(OSSIM_DIRECTION_UNKNOWN)
18 {
19 }
20 
22  ossimObject* object,
23  long id,
26  ossimConnectionDirectionType whichDirection)
27  : ossimEvent(object, id),
28  theNewObjectList(newList),
29  theOldObjectList(oldList),
30  theDirectionType(whichDirection)
31 {
32 }
33 
35  ossimObject* object,
36  long id,
37  ossimConnectableObject* newConnectableObject,
38  ossimConnectableObject* oldConnectableObject,
39  ossimConnectionDirectionType whichDirection)
40  : ossimEvent(object, id),
41  theDirectionType(whichDirection)
42 {
43  if(newConnectableObject)
44  {
45  theNewObjectList.push_back(newConnectableObject);
46  }
47  if(oldConnectableObject)
48  {
49  theOldObjectList.push_back(oldConnectableObject);
50  }
51 }
52 
54  : ossimEvent(rhs),
55  theNewObjectList(rhs.theNewObjectList),
56  theOldObjectList(rhs.theOldObjectList),
57  theDirectionType(rhs.theDirectionType)
58 {
59 }
60 
62 {
63  return new ossimConnectionEvent(*this);
64 }
65 
68 {
69  theDirectionType = direction;
70 }
71 
73 {
74  return theDirectionType;
75 }
76 
78 {
79  return (ossim_uint32)theNewObjectList.size();
80 }
81 
83 {
84  return (ossim_uint32)theOldObjectList.size();
85 }
86 
88 {
89  if(i < getNumberOfOldObjects())
90  {
91  return theOldObjectList[i].get();
92  }
93 
94  return (ossimConnectableObject*)NULL;
95 }
96 
98 {
99  if(i < getNumberOfNewObjects())
100  {
101  return theNewObjectList[i].get();
102  }
103 
104  return (ossimConnectableObject*)NULL;
105 }
106 
108 {
110 }
111 
113 {
115 }
116 
118 {
119  return ((long)theDirectionType & (long)OSSIM_INPUT_DIRECTION);
120 }
121 
123 {
124  return ((long)theDirectionType & OSSIM_OUTPUT_DIRECTION);
125 }
ossimObject * dup() const
ossimConnectableObject::ConnectableObjectList theOldObjectList
virtual bool isConnect() const
virtual void setDirection(ossimConnectionDirectionType direction)
virtual ossim_uint32 getNumberOfOldObjects() const
#define OSSIM_EVENT_CONNECTION_DISCONNECT_ID
Definition: ossimEventIds.h:21
virtual bool isInputDirection() const
virtual ossim_uint32 getNumberOfNewObjects() const
ossimConnectableObject::ConnectableObjectList theNewObjectList
RTTI_DEF1(ossimConnectionEvent, "ossimConnectionEvent", ossimEvent)
virtual ossimConnectableObject * getNewObject(ossim_uint32 i=0)
std::vector< ossimRefPtr< ossimConnectableObject > > ConnectableObjectList
#define OSSIM_EVENT_CONNECTION_CONNECT_ID
Definition: ossimEventIds.h:22
virtual ossimConnectionDirectionType getDirection() const
unsigned int ossim_uint32
ossimConnectionDirectionType theDirectionType
virtual bool isDisconnect() const
long getId() const
Definition: ossimEvent.cpp:39
virtual ossimConnectableObject * getOldObject(ossim_uint32 i=0)
ossimConnectionEvent(ossimObject *object=NULL, long id=OSSIM_EVENT_NULL_ID)
virtual bool isOutputDirection() const