#ifndef __NodeKey_H__
#define __NodeKey_H__
#include <MediaDefs.h>
#include "StringContent.h"
#include "cortex_defs.h"
__BEGIN_CORTEX_NAMESPACE
class NodeKey :
public StringContent {
public:
const char* key() const { return content.String(); }
media_node_id node() const { return m_node; }
public:
virtual ~NodeKey() {}
NodeKey() : m_node(0) {}
NodeKey(
const NodeKey& clone) { _clone(clone); }
NodeKey& operator=(
const NodeKey& clone) { _clone(clone); return *this; }
bool operator<(
const NodeKey& other) const {
return key() < other.key();
}
public:
virtual void xmlExportBegin(
ExportContext& context) const;
virtual void xmlExportAttributes(
ExportContext& context) const;
virtual void xmlExportContent(
ExportContext& context) const;
virtual void xmlExportEnd(
ExportContext& context) const;
private:
friend class RouteAppNodeManager;
NodeKey(
const char* _key,
media_node_id _node) :
StringContent(_key),
m_node(_node) {}
private:
inline void _clone(
const NodeKey& clone) {
content = clone.content;
m_node = clone.m_node;
}
media_node_id m_node;
static const char* const s_element;
};
__END_CORTEX_NAMESPACE
#endif