Skip to content

Commit 5bf1404

Browse files
authored
Merge pull request #226 from JohanMabille/variable
Variable
2 parents 089e3cd + ee74499 commit 5bf1404

4 files changed

Lines changed: 730 additions & 559 deletions

File tree

include/xframe/xaxis_variant.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace xf
6262
{
6363
using tmp_storage_type = xtl::variant<xaxis<L, S, MT>...>;
6464
using storage_type = add_default_axis_t<tmp_storage_type, S, L...>;
65-
using label_list = xvector_variant_cref<L...>;
65+
using label_list = xvector_variant_cref<std::vector<L>...>;
6666
using key_type = xtl::variant<typename xaxis<L, S, MT>::key_type...>;
6767
using key_reference = xtl::variant<xtl::xclosure_wrapper<const typename xaxis<L, S, MT>::key_type&>...>;
6868
using mapped_type = S;
@@ -540,7 +540,7 @@ namespace xf
540540

541541
inline const label_list& labels() const
542542
{
543-
return xget_vector<key_type>(m_axis.labels());
543+
return xget_vector<std::vector<key_type>>(m_axis.labels());
544544
};
545545

546546
inline bool is_sorted() const noexcept
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/***************************************************************************
2+
* Copyright (c) 2017, Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
3+
* Martin Renou *
4+
* *
5+
* Distributed under the terms of the BSD 3-Clause License. *
6+
* *
7+
* The full license is in the file LICENSE, distributed with this software. *
8+
****************************************************************************/
9+
10+
#ifndef XFRAME_XVARIABLE_VARIANT_HPP
11+
#define XFRAME_XVARIABLE_VARIANT_HPP
12+
13+
#include "xvariable.hpp"
14+
15+
namespace xf
16+
{
17+
18+
19+
template <class... V>
20+
class xvariable_variant
21+
{
22+
};
23+
24+
// vtype1 = variable<double, coord_type1>;
25+
// vtype2 variable<int, coord_type2>;
26+
// vtype1 v1;
27+
// vtype2 v2;
28+
29+
// auto fr = ("n1", v1) | ("n2", v2);
30+
// ftype = xframe<L, vtype1, vtype2>;
31+
// ftype::vtype = variant<variable<double, coord_type1>&, variable<int, coord_type2>&>
32+
// ftype::vtype::value_type = variant<vtype1::value_type, vtype1::value_type>;
33+
// ftype::vtype::coordinate_type = variant<vtype1::coordinate_type, vtype2::coordinate_type>;
34+
// ftype::vtype::dimension_type = variant<vtype1::dimension_type, vtype2::dimension_type>;
35+
// ftype::vtype::data_type = variant<vtype1::data_type, vtype2::deta_type>
36+
// ftype::ctype = xcommon_coordinate_type<coord_type1, coord_type2>;
37+
// ftype::dtype = xcommon_dimension_type<typename vtype1::dimension_type, typename vtype2::dimension_type>;
38+
//
39+
// xframe not aligned:
40+
// std::map<L, ftype::vtype>;
41+
// ftype::ctype m_coord;
42+
// ftype::dtype m_dims;
43+
// f["n1"] returns ??
44+
//
45+
// xframe aligned
46+
// std::map<L, ftype::vtype::data_type>;
47+
// ftype::ctype m_coord;
48+
// ftype::dtype m_dims;
49+
// f["n1"]
50+
}
51+
52+
#endif
53+

0 commit comments

Comments
 (0)