Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 10, 2008, 1:43:14 AM (17 years ago)
Author:
landauf
Message:

started implementing a Namespace object (which will be used in level files to create and access groups of objects)

Location:
code/branches/core2/src/orxonox/core
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/core/BaseObject.h

    r871 r877  
    7979            const std::string& getLevelfile() const;
    8080
     81            inline void setNamespace(Namespace* ns) { this->namespace_ = ns; }
     82            inline Namespace* getNamespace() const { return this->namespace_; }
     83
    8184            /** @brief Sets the indentation of the debug output in the Loader. @param indentation The indentation */
    8285            inline void setLoaderIndentation(const std::string& indentation) { this->loaderIndentation_ = indentation; }
     
    9093            const Level* level_;                        //!< The level that loaded this object
    9194            std::string loaderIndentation_;             //!< Indentation of the debug output in the Loader
     95            Namespace* namespace_;
    9296    };
    9397}
  • code/branches/core2/src/orxonox/core/CMakeLists.txt

    r871 r877  
    1717  Executor.cc
    1818  XMLPort.cc
     19  Namespace.cc
    1920)
    2021
  • code/branches/core2/src/orxonox/core/CorePrereqs.h

    r871 r877  
    9595  template <class T>
    9696  class MetaObjectListElement;
     97  class Namespace;
    9798  template <class T>
    9899  class ObjectList;
  • code/branches/core2/src/orxonox/core/Loader.cc

    r871 r877  
    115115            xmlfile.LoadFile();
    116116
    117             for ( ticpp::Iterator<ticpp::Element> child = xmlfile.FirstChildElement(false); child != child.end(); child++ )
     117            for (ticpp::Iterator<ticpp::Element> child = xmlfile.FirstChildElement(false); child != child.end(); child++)
    118118            {
    119119                Identifier* identifier = ID(child->Value());
  • code/branches/core2/src/orxonox/core/XMLPort.h

    r871 r877  
    211211    {
    212212        public:
    213             XMLPortClassObjectContainer(const std::string classname, const std::string sectionname, void (T::*loadfunction)(O*), const O* (T::*savefunction)(unsigned int))
     213            XMLPortClassObjectContainer(const std::string classname, const std::string sectionname, void (T::*loadfunction)(O*), const O* (T::*savefunction)(unsigned int) const)
    214214            {
    215215                this->classname_ = classname;
     
    225225                    try
    226226                    {
    227                         Element* xmlsubelement = xmlelement.FirstChildElement(this->sectionname_, false);
     227                        Element* xmlsubelement;
     228                        if (this->sectionname_ != "")
     229                            xmlsubelement = xmlelement.FirstChildElement(this->sectionname_, false);
     230                        else
     231                            xmlsubelement = &xmlelement;
    228232
    229233                        if (xmlsubelement)
    230234                        {
    231                             for ( ticpp::Iterator<ticpp::Element> child = xmlsubelement->FirstChildElement(false); child != child.end(); child++ )
     235                            for (ticpp::Iterator<ticpp::Element> child = xmlsubelement->FirstChildElement(false); child != child.end(); child++)
    232236                            {
    233237                                Identifier* identifier = ID(child->Value());
     
    276280        private:
    277281            void     (T::*loadfunction_)(O*);
    278             const O* (T::*savefunction_)(unsigned int);
     282            const O* (T::*savefunction_)(unsigned int) const;
    279283    };
    280284}
Note: See TracChangeset for help on using the changeset viewer.