X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FEvents%2FEvents_Message.h;h=ba1e922376f65572e417412b4f7fcf2e43cadb2e;hb=c8fd356b4c1e7fb116023cfc9bc4ac87915607b0;hp=fe829a46895ad8da1c6049ebe5978a3088fc9909;hpb=4cbd08290dc7a540e3fa93913d484e8336df90d9;p=modules%2Fshaper.git diff --git a/src/Events/Events_Message.h b/src/Events/Events_Message.h index fe829a468..ba1e92237 100644 --- a/src/Events/Events_Message.h +++ b/src/Events/Events_Message.h @@ -1,6 +1,22 @@ -// File: Events_Message.hxx -// Created: Thu Mar 13 2014 -// Author: Mikhail PONIKAROV +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com +// #ifndef Events_Message_H_ #define Events_Message_H_ @@ -12,22 +28,33 @@ * \brief Identifier of the event kind. * * Each event ID is created in main Envent_Loop class - * that stores correspondance between the string-name of the + * that stores correspondence between the string-name of the * identifier and the pointer to the static string that is really - * used as an identifier (this is usefull for debugging of the events + * used as an identifier (this is useful for debugging of the events * with log files and in debugger). */ -class EVENTS_EXPORT Events_ID { - char* myID; ///< pointer to the text-identifier of the event, unique pointer for all events of such type +class EVENTS_EXPORT Events_ID +{ + /// pointer to the text-identifier of the event, unique pointer for all events of such type + char* myID; - Events_ID(char* theID) {myID = theID;} + Events_ID(char* theID) + { + myID = theID; + } friend class Events_Loop; -public: + public: /// Returns the text-identifier of the event (for debugging reasons) - char* eventText() const {return myID;} + char* eventText() const + { + return myID; + } /// Allows to compare identifiers - bool operator==(const Events_ID& theID) const {return myID == theID.myID;} + bool operator==(const Events_ID& theID) const + { + return myID == theID.myID; + } }; /**\class Events_Message @@ -35,23 +62,35 @@ public: * \brief Message for communication between sender and listener of event. * Normally it is inherited by the higher-level */ -class EVENTS_EXPORT Events_Message { - Events_ID myEventsId; ///< identifier of the event - void* mySender; ///< the sender object +class EVENTS_EXPORT Events_Message +{ + Events_ID myEventsId; ///< identifier of the event + void* mySender; ///< the sender object -public: + public: //! Creates the message Events_Message(const Events_ID theID, const void* theSender = 0) - : myEventsId(theID), mySender((void*) theSender) {} + : myEventsId(theID), + mySender((void*) theSender) + { + } //! do nothing in the destructor yet - virtual ~Events_Message() {} + virtual ~Events_Message() + { + } //! Returns identifier of the message - const Events_ID& eventID() const {return myEventsId;} + const Events_ID& eventID() const + { + return myEventsId; + } //! Returns sender of the message or NULL if it is anonymous message - void* sender() const {return mySender;} + void* sender() const + { + return mySender; + } }; #endif