XrdClMessage.hh

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN)
00003 // Author: Lukasz Janyst <ljanyst@cern.ch>
00004 //------------------------------------------------------------------------------
00005 // XRootD is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU Lesser General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // XRootD is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public License
00016 // along with XRootD.  If not, see <http://www.gnu.org/licenses/>.
00017 //------------------------------------------------------------------------------
00018 
00019 #ifndef __XRD_CL_MESSAGE_HH__
00020 #define __XRD_CL_MESSAGE_HH__
00021 
00022 #include "XrdCl/XrdClBuffer.hh"
00023 
00024 namespace XrdCl
00025 {
00026   //----------------------------------------------------------------------------
00028   //----------------------------------------------------------------------------
00029   class Message: public Buffer
00030   {
00031     public:
00032       //------------------------------------------------------------------------
00034       //------------------------------------------------------------------------
00035       Message( uint32_t size = 0 ):
00036         Buffer( size ), pIsMarshalled( false ), pSessionId(0)
00037       {
00038         if( size )
00039           Zero();
00040       }
00041 
00042       //------------------------------------------------------------------------
00044       //------------------------------------------------------------------------
00045       virtual ~Message() {}
00046 
00047       //------------------------------------------------------------------------
00049       //------------------------------------------------------------------------
00050       bool IsMarshalled() const
00051       {
00052         return pIsMarshalled;
00053       }
00054 
00055       //------------------------------------------------------------------------
00057       //------------------------------------------------------------------------
00058       void SetIsMarshalled( bool isMarshalled )
00059       {
00060         pIsMarshalled = isMarshalled;
00061       }
00062 
00063       //------------------------------------------------------------------------
00065       //------------------------------------------------------------------------
00066       void SetDescription( const std::string &description )
00067       {
00068         pDescription = description;
00069       }
00070 
00071       //------------------------------------------------------------------------
00073       //------------------------------------------------------------------------
00074       const std::string &GetDescription() const
00075       {
00076         return pDescription;
00077       }
00078 
00079       //------------------------------------------------------------------------
00081       //------------------------------------------------------------------------
00082       void SetSessionId( uint64_t sessionId )
00083       {
00084         pSessionId = sessionId;
00085       }
00086 
00087       //------------------------------------------------------------------------
00089       //------------------------------------------------------------------------
00090       uint64_t GetSessionId() const
00091       {
00092         return pSessionId;
00093       }
00094 
00095     private:
00096       bool         pIsMarshalled;
00097       uint64_t     pSessionId;
00098       std::string  pDescription;
00099   };
00100 }
00101 
00102 #endif // __XRD_CL_MESSAGE_HH__

Generated on 27 Jul 2013 for xrootd by  doxygen 1.4.7