Vita
category_set.h
Go to the documentation of this file.
1
13#if !defined(VITA_CATEGORY_SET_H)
14#define VITA_CATEGORY_SET_H
15
16#include <iostream>
17#include <set>
18#include <string>
19
20#include "kernel/common.h"
21#include "kernel/value.h"
23
24namespace vita
25{
26
39enum class typing {weak, strong};
40
42{
43 static const category_info null;
44
45 category_t category = undefined_category;
46 domain_t domain = d_void;
47 std::string name = {};
48};
49
50std::ostream &operator<<(std::ostream &, const category_info &);
51bool operator==(const category_info &, const category_info &);
52
68{
69public:
70 class const_iterator;
71
72 explicit category_set(const dataframe::columns_info &, typing = typing::weak);
73
74 const category_info &category(category_t) const;
75 const category_info &column(std::size_t) const;
76 const category_info &column(const std::string &) const;
77
78 std::set<category_t> used_categories() const;
79
80 auto begin() const { return columns_.begin(); }
81 auto end() const { return columns_.end(); }
82
83 bool is_valid() const;
84
85private:
86 std::vector<category_info> columns_;
87}; // class category_set
88
89} // namespace vita
90#endif // include guard
Information about the set of categories used in a specific problem.
Definition: category_set.h:68
const category_info & category(category_t) const
Definition: category_set.cc:64
const category_info & column(std::size_t) const
Definition: category_set.cc:78
std::set< category_t > used_categories() const
bool is_valid() const
category_set(const dataframe::columns_info &, typing=typing::weak)
Builds a category_set extracting data from a columns_info object.
Definition: category_set.cc:30
Information about the collection of columns (type, name, output index).
Definition: dataframe.h:69
The main namespace for the project.
typing
Category/type management of the dataframe columns.
Definition: category_set.h:39
domain_t
In an environment where a symbol such as '+' may have many different meanings, it's useful to specify...
Definition: value.h:34
std::size_t category_t
A category provide operations which supplement or supersede those of the domain but which are restric...
Definition: common.h:44
std::ostream & operator<<(std::ostream &o, hash_t h)
Mainly useful for debugging / testing.
Definition: cache_hash.cc:56