owlcpp  v0.3.3~
C++ library for working with OWL ontologies
 All Classes Namespaces Files Functions Macros Pages
Macros
ns_iri_tag_macro.hpp File Reference
#include <string>
#include "owlcpp/ns_id.hpp"

Go to the source code of this file.

Macros

#define OWLCPP_NAMESPACE_TAG_TYPE(name, prefix_str, iri_str, i)
 Generate namespace IRI tag struct.

Detailed Description

part of owlcpp project.

Distributed under the Boost Software License, Version 1.0; see doc/license.txt.
Copyright Mikhail K Levin 2013

Macro Definition Documentation

#define OWLCPP_NAMESPACE_TAG_TYPE (   name,
  prefix_str,
  iri_str,
 
)
Value:
struct name { \
typedef ::owlcpp::Ns_id id_type; \
static const id_type::value_type index = i; \
static std::string const & iri() { \
static const std::string str=iri_str; \
return str; \
} \
static std::string const & prefix() { \
static const std::string str=prefix_str; \
return str; \
} \
static id_type id() {return id_type(index);} \
}

Generate namespace IRI tag struct.

e.g.,

rdfs, "rdfs", "http://www.w3.org/2000/01/rdf-schema", 3
);

expands to

struct rdfs {
static const unsigned index = 3;
static std::string const & iri() {
static const std::string str="http://www.w3.org/2000/01/rdf-schema";
return str;
}
static std::string const & prefix() {
static const std::string str="rdfs";
return str;
}
typedef ::owlcpp::Ns_id id_type;
static id_type id() {return id_type(index);}
};