00001 /* 00002 * Event.hpp 00003 * 00004 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 00005 * 00006 * Oracle is a registered trademarks of Oracle Corporation and/or its 00007 * affiliates. 00008 * 00009 * This software is the confidential and proprietary information of Oracle 00010 * Corporation. You shall not disclose such confidential and proprietary 00011 * information and shall use it only in accordance with the terms of the 00012 * license agreement you entered into with Oracle. 00013 * 00014 * This notice may not be removed or altered. 00015 */ 00016 #ifndef COH_EVENT_HPP 00017 #define COH_EVENT_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include <ostream> 00022 00023 COH_OPEN_NAMESPACE2(coherence,util) 00024 00025 00026 /** 00027 * The root class from which all event state classes shall be derived. 00028 * <p> 00029 * All Events are constructed with a reference to the object, the "source", 00030 * that is logically deemed to be the object upon which the Event in question 00031 * initially occurred. 00032 * 00033 * @author jh 2007.12.12 00034 */ 00035 class COH_EXPORT Event 00036 : public class_spec<Event> 00037 { 00038 friend class factory<Event>; 00039 00040 // ----- constructors --------------------------------------------------- 00041 00042 protected: 00043 /** 00044 * Create a new Event instance. 00045 * 00046 * @param vSource the source associated with the new Event 00047 * 00048 * @return a new Event 00049 */ 00050 Event(Object::View vSource); 00051 00052 00053 // ----- Object interface ----------------------------------------------- 00054 00055 public: 00056 /** 00057 * {@inheritDoc} 00058 */ 00059 virtual void toStream(std::ostream& out) const; 00060 00061 00062 // ----- accessors ------------------------------------------------------ 00063 00064 public: 00065 /** 00066 * Return the object on which the Event initially occurred. 00067 * 00068 * @return the object on which the Event initially occurred 00069 */ 00070 virtual Object::View getSource() const; 00071 00072 00073 // ----- data members --------------------------------------------------- 00074 00075 protected: 00076 /** 00077 * The object on which the Event initially occurred. 00078 */ 00079 FinalView<Object> m_vSource; 00080 }; 00081 00082 COH_CLOSE_NAMESPACE2 00083 00084 #endif // COH_EVENT_HPP