"Fossies" - the Fresh Open Source Software Archive

Member "OpenSP-1.5.2/include/Named.h" (21 Jul 2005, 605 Bytes) of package /linux/misc/old/OpenSP-1.5.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Named.h" see the Fossies "Dox" file reference documentation.

    1 // Copyright (c) 1994 James Clark
    2 // See the file COPYING for copying permission.
    3 
    4 #ifndef Named_INCLUDED
    5 #define Named_INCLUDED 1
    6 
    7 #include "StringC.h"
    8 
    9 #ifdef SP_NAMESPACE
   10 namespace SP_NAMESPACE {
   11 #endif
   12 
   13 class SP_API Named {
   14 public:
   15   Named(const StringC &name) : name_(name) { }
   16   virtual ~Named() { }
   17   const StringC &name() const { return name_; }
   18   const StringC *namePointer() const { return &name_; }
   19   void setName(const StringC &name) { name_ = name; }
   20   void swap(Named &to) { name_.swap(to.name_); }
   21 private:
   22   StringC name_;
   23 };
   24 
   25 #ifdef SP_NAMESPACE
   26 }
   27 #endif
   28 
   29 #endif /* not Named_INCLUDED */