00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Raphael Langerhorst * 00003 * raphael-langerhorst@gmx.at * 00004 * * 00005 * Permission is hereby granted, free of charge, to any person obtaining * 00006 * a copy of this software and associated documentation files (the * 00007 * "Software"), to deal in the Software without restriction, including * 00008 * without limitation the rights to use, copy, modify, merge, publish, * 00009 * distribute, sublicense, and/or sell copies of the Software, and to * 00010 * permit persons to whom the Software is furnished to do so, subject to * 00011 * the following conditions: * 00012 * * 00013 * The above copyright notice and this permission notice shall be * 00014 * included in all copies or substantial portions of the Software. * 00015 * * 00016 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * 00017 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 00018 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.* 00019 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR * 00020 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * 00021 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * 00022 * OTHER DEALINGS IN THE SOFTWARE. * 00023 ***************************************************************************/ 00024 00025 #ifndef GCSGWORLDDATA_H 00026 #define GCSGWORLDDATA_H 00027 00028 #include "GElementID.h" 00029 00030 #include <QList> 00031 00032 namespace GCS 00033 { 00034 00035 class GElement; 00036 00057 class GWorldData 00058 { 00059 protected: 00060 00064 GWorldData() 00065 {} 00066 00067 public: 00068 00072 virtual ~GWorldData() 00073 {} 00074 00083 virtual const GElement* read(const GElementID& id) const = 0; 00084 00085 // /** 00086 // * Starts at a random element and goes up the hierarchy until it reaches 00087 // * the top most (root) element. The root element of the world is identified 00088 // * with this test: (element id == parent id || parent id == 0) 00089 // * @note If there is more than one element without a parent the result is 00090 // * unpredictable. 00091 // * @return the top most element in the hierarchy 00092 // */ 00093 // virtual const GElement* getRootElement() const = 0; 00094 00098 virtual QList<GCS::GElementID> getChildren(const GCS::GElementID& parent) const = 0; 00099 00100 }; 00101 00102 } 00103 00104 #endif
1.4.7