00001 /* 00002 * This file is part of the "Archon" framework. 00003 * (http://files3d.sourceforge.net) 00004 * 00005 * Copyright © 2002 by Kristian Spangsege and Brian Kristiansen. 00006 * 00007 * Permission to use, copy, modify, and distribute this software and 00008 * its documentation under the terms of the GNU General Public License is 00009 * hereby granted. No representations are made about the suitability of 00010 * this software for any purpose. It is provided "as is" without express 00011 * or implied warranty. See the GNU General Public License 00012 * (http://www.gnu.org/copyleft/gpl.html) for more details. 00013 * 00014 * The characters in this file are ISO8859-1 encoded. 00015 * 00016 * The documentation in this file is in "Doxygen" style 00017 * (http://www.doxygen.org). 00018 */ 00019 00020 #ifndef ARCHON_X3D_PROXY_TYPE_H 00021 #define ARCHON_X3D_PROXY_TYPE_H 00022 00023 #include <string> 00024 00025 namespace Archon 00026 { 00027 namespace X3D 00028 { 00029 namespace Proxy 00030 { 00031 using namespace std; 00032 00033 struct NodeBase; 00034 struct Session; 00035 00036 typedef NodeBase *(*NodeInstantiator)(Session *, unsigned long id); 00037 00038 struct FieldDef 00039 { 00040 const char *name; 00041 }; 00042 00043 struct NodeDef 00044 { 00045 const char *name; 00046 NodeInstantiator instantiator; 00047 unsigned numberOfFields; 00048 const FieldDef *fields; 00049 }; 00050 00051 extern const NodeDef nodeDefs[]; 00052 00053 struct FieldLink 00054 { 00055 unsigned long id; // 1 + the ID known by the server, zero 00056 // indicates "no server support" 00057 }; 00058 00059 struct NodeLink 00060 { 00061 unsigned long id; // 1 + the ID known by the server, zero 00062 // indicates "no server support" 00063 FieldLink *fields; 00064 00065 NodeLink(): id(0), fields(0) {} 00066 ~NodeLink() {{ if(fields) delete[] fields; }} 00067 }; 00068 } 00069 } 00070 } 00071 00072 #endif // ARCHON_X3D_PROXY_TYPE_H