2 * Copyright 2011-2015, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
5 #ifndef BMESSAGE_VALUE_NODE_H
6 #define BMESSAGE_VALUE_NODE_H
9 #include <MessagePrivate.h>
10 #include <ObjectList.h>
13 #include "ValueLocation.h"
14 #include "ValueNode.h"
20 class BMessageValueNode
: public ValueNode
{
23 ValueNodeChild
* nodeChild
, Type
* type
);
24 virtual ~BMessageValueNode();
26 virtual Type
* GetType() const;
27 virtual status_t
ResolvedLocationAndValue(
28 ValueLoader
* valueLoader
,
29 ValueLocation
*& _location
,
32 virtual bool ChildCreationNeedsValue() const
34 virtual status_t
CreateChildren(TeamTypeInformation
* info
);
35 virtual int32
CountChildren() const;
36 virtual ValueNodeChild
* ChildAt(int32 index
) const;
40 status_t
_GetTypeForTypeCode(
41 TeamTypeInformation
* info
,
44 status_t
_FindField(const char* name
,
46 BMessage::field_header
** result
) const;
47 uint32
_HashName(const char* name
) const;
48 status_t
_FindDataLocation(const char* name
,
49 type_code type
, int32 index
,
50 ValueLocation
& location
) const;
53 class BMessageFieldNode
;
54 class BMessageFieldNodeChild
;
57 friend class BMessageFieldNode
;
58 friend class BMessageFieldNodeChild
;
59 friend class BMessageWhatNodeChild
;
61 typedef BObjectList
<ValueNodeChild
> ChildNodeList
;
65 ChildNodeList fChildren
;
66 BVariant fDataLocation
;
67 BMessage::message_header
*
69 BMessage::field_header
* fFields
;
76 class BMessageValueNode::BMessageFieldNode
: public ValueNode
{
79 BMessageFieldNodeChild
*child
,
80 BMessageValueNode
* parent
,
82 type_code type
, int32 count
);
84 virtual ~BMessageFieldNode();
86 virtual Type
* GetType() const;
88 virtual status_t
ResolvedLocationAndValue(
90 ValueLocation
*& _location
,
93 virtual status_t
CreateChildren(TeamTypeInformation
* info
);
94 virtual int32
CountChildren() const;
95 virtual ValueNodeChild
* ChildAt(int32 index
) const;
100 BMessageValueNode
* fParent
;
101 type_code fFieldType
;
103 ChildNodeList fChildren
;
107 class BMessageValueNode::BMessageFieldNodeChild
: public ValueNodeChild
{
109 BMessageFieldNodeChild(
110 BMessageValueNode
* parent
,
113 type_code type
, int32 count
,
116 virtual ~BMessageFieldNodeChild();
118 virtual const BString
& Name() const;
119 virtual Type
* GetType() const;
120 virtual ValueNode
* Parent() const;
122 virtual bool IsInternal() const;
123 virtual status_t
CreateInternalNode(
126 virtual status_t
ResolveLocation(ValueLoader
* valueLoader
,
127 ValueLocation
*& _location
);
131 BString fPresentationName
;
133 BMessageValueNode
* fParent
;
134 type_code fFieldType
;
139 #endif // BMESSAGE_VALUE_NODE_H