source: XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp @ 108

Last change on this file since 108 was 108, checked in by hozdoba, 14 years ago

Début de prise en charge des références (sans contrÎle ni transmission d'attribut pour le moment).

File size: 1.4 KB
Line 
1#ifndef __FIELD__
2#define __FIELD__
3
4using XMLIOSERVER::XML::XMLNode;
5using XMLIOSERVER::XML::THashAttributes;
6
7namespace XMLIOSERVER
8{
9   class CField : public ObjectTemplate<CField>, public FieldAttribut
10   {
11      public:
12
13         CField(void) : ObjectTemplate<CField>(), FieldAttribut()
14         {/* Ne rien faire de plus */}
15         CField(const string& _id) : ObjectTemplate<CField>(_id), FieldAttribut()
16         {/* Ne rien faire de plus */}
17
18         static string GetName(void) {return ("field"); }
19
20         virtual CField* getReference(void) const
21         {
22            if(!field_ref._hasValue()) return (NULL);
23            string refname = field_ref;
24            if (!CField::HasObject(refname))
25            { WARNING("Référence invalide sur l'objet "+GetName()+" nommé \""+refname+"\""); return (NULL);}
26
27            return (&CField::GetObject(field_ref));
28         }
29
30         void parse (XMLNode& _node)
31         {
32            string name = _node.getElementName();
33            THashAttributes attributes;
34
35            /// PARSING GESTION DES ATTRIBUTS ///
36            _node.getAttributes(attributes);
37            this->setAttributes(attributes);
38            attributes.clear();
39
40            /// PARSING POUR GESION DES ENFANTS
41            // Rien à faire.
42         }
43
44         ~CField(void)
45         { /* Ne rien faire de plus */ }
46
47   }; // class Field
48
49}; // namespace XMLIOSERVER
50
51#endif // __FIELD__
Note: See TracBrowser for help on using the repository browser.