2 * Copyright (c) 1999-2000, Eric Moon.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions, and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions, and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
27 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 // * PURPOSE +++++ SUPERCEDED BY LiveNodeIO 20dec99 +++++
35 // An IPersistent implementation that stores a string
36 // identifier (key) for a media node whose description
37 // is being imported from or exported to a stream.
39 // A NodeKey may refer to a user-created node or one
40 // of the following system-defined nodes:
51 // e.moon 7dec99 Begun
56 #include <MediaDefs.h>
57 #include "StringContent.h"
59 #include "cortex_defs.h"
61 __BEGIN_CORTEX_NAMESPACE
64 public StringContent
{
66 public: // content access
68 const char* key() const { return content
.String(); }
70 // if the corresponding node doesn't exist, returns 0
71 media_node_id
node() const { return m_node
; }
73 public: // *** dtor, default ctors
75 NodeKey() : m_node(0) {}
77 const NodeKey
& clone
) { _clone(clone
); }
79 const NodeKey
& clone
) { _clone(clone
); return *this; }
82 const NodeKey
& other
) const {
83 return key() < other
.key();
86 public: // *** IPersistent
90 virtual void xmlExportBegin(
91 ExportContext
& context
) const;
93 virtual void xmlExportAttributes(
94 ExportContext
& context
) const;
96 virtual void xmlExportContent(
97 ExportContext
& context
) const;
99 virtual void xmlExportEnd(
100 ExportContext
& context
) const;
104 friend class RouteAppNodeManager
;
108 media_node_id _node
) :
114 const NodeKey
& clone
) {
115 content
= clone
.content
;
116 m_node
= clone
.m_node
;
119 media_node_id m_node
;
121 static const char* const s_element
;
124 __END_CORTEX_NAMESPACE
125 #endif /*__NodeKey_H__ */