# Named.hh

Go to the documentation of this file.

    00001 // ----------------------------------------------------------------------------
    00002 // CERTI - HLA RunTime Infrastructure
    00003 // Copyright (C) 2004  ONERA
    00004 //
    00005 // This file is part of CERTI-libCERTI
    00006 //
    00007 // CERTI-libCERTI is free software ; you can redistribute it and/or
    00008 // modify it under the terms of the GNU Lesser General Public License
    00009 // as published by the Free Software Foundation ; either version 2 of
    00010 // the License, or (at your option) any later version.
    00011 //
    00012 // CERTI-libCERTI is distributed in the hope that it will be useful, but
    00013 // WITHOUT ANY WARRANTY ; without even the implied warranty of
    00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    00015 // Lesser General Public License for more details.
    00016 //
    00017 // You should have received a copy of the GNU Lesser General Public
    00018 // License along with this program ; if not, write to the Free Software
    00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
    00020 // USA
    00021 //
    00022 // $Id: Named.hh,v 3.8 2008/11/08 00:59:38 erk Exp $
    00023 // ----------------------------------------------------------------------------
    00024
    00025 #ifndef LIBCERTI_NAMED_HH
    00026 #define LIBCERTI_NAMED_HH
    00027
    00028 #include <string>
    00029
    00030 namespace certi {
    00031
    00041 class Named
    00042 {
    00043 public:
    00048     Named();
    00049
    00054     Named(const std::string newName);
    00055
    00060     virtual ~Named();
    00061
    00066     virtual void setName(const std::string newName);
    00067
    00072     virtual void setName(const char* newName);
    00073
    00078     virtual const std::string& getName() const ;
    00079
    00084     virtual const char *getCName() const ;
    00085
    00091     bool isNamed(const std::string& newName) const ;
    00092
    00099     static bool validateHLAName(const std::string& name);
    00100
    00110     static bool isQualifiedClassName(const std::string& name);
    00111
    00117     static std::string getNextClassName(std::string& qualifiedClassName);
    00118
    00124     static std::string getLeafClassName(std::string qualifiedClassName);
    00125
    00126     class IsNamed {
    00127         public:
    00128             IsNamed(const std::string named) : named(named) {};
    00129             bool operator()(const Named& namedObject) {
    00130                 return (namedObject.getName() == named);
    00131             }
    00132         private:
    00133             std::string named;
    00134     };
    00135
    00136 protected:
    00137
    00138     std::string name ;
    00139 };
    00140
    00141 } // certi
    00142
    00143 #endif // LIBCERTI_NAMED_HH
    00144
    00145 // $Id: Named.hh,v 3.8 2008/11/08 00:59:38 erk Exp $