True Axis Physics SDK 1.2.0.1 Beta Documentation
www.trueaxis.com

DescriptorItem.h

00001 //---------------------------------------------------------------------------------
00002 // File Name: DescriptorItem.h
00003 // Description:
00004 //
00005 // Copyright (C) 2004 True Axis Pty Ltd, Australia. 
00006 // All Rights Reserved.
00007 //
00008 // History:
00009 //      Created File.
00010 //---------------------------------------------------------------------------------
00011 
00012 #ifndef TA_DESCRIPTORITEM_H
00013 #define TA_DESCRIPTORITEM_H
00014 
00015 #ifndef TA_STRING_H
00016 #include "String.h"
00017 #endif // TA_STRING_H
00018 
00019 #ifndef TA_LIST_H
00020 #include "List.h"
00021 #endif // TA_LIST_H
00022 
00023 #ifndef TA_DESCRIPTORID_H
00024 #include "DescriptorID.h"
00025 #endif // TA_DESCRIPTORID_H
00026 
00027 namespace TA
00028 {
00029 
00030 class Descriptor;
00031 class AmlReader;
00032 
00033 class TACOMMON_CLASS DescriptorItem : public DescriptorID
00034 {
00035 public:
00036     typedef List<DescriptorItem*>::Iterator ChildIterator;
00037 
00038     DescriptorItem();
00039     virtual ~DescriptorItem();
00040 
00041     void Initialise(const Char* szName, const Char* szDescription);
00042     void Finalise();
00043 
00044     void AddChild(DescriptorItem* pChild);
00045     DescriptorItem* GetParent() { return m_pParent; }
00046     ChildIterator GetChildIterator() { return m_childList.GetIterator(); }
00047     DescriptorItem* GetChild(const Char* szName);
00048 
00049     const String& GetName() const { return m_strName; }
00050 
00051     virtual String GetValueAsString(Descriptor* pDescriptor) const = 0;
00052     virtual String GetDisplayString(Descriptor* pDescriptor) const = 0;
00053     virtual void SetValueFromString(const char* szString, Descriptor* pDescriptor) = 0;
00054     virtual void SetToDefaultValue(Descriptor* pDescriptor) = 0;
00055 
00056     virtual void Read(AmlReader& amlReader, Descriptor* pDescriptor);
00057 
00058 private:
00059     String m_strName;
00060     String m_strDescription;
00061     List<DescriptorItem*> m_childList;
00062     DescriptorItem* m_pParent;
00063 };
00064 
00065 };
00066 
00067 #endif // TA_DESCRIPTORITEM_H


© Copyright 2004-2006 TRUE AXIS PTY LTD Australia. All rights reserved.