1 /*
2  * Copyright 2019 by its authors. See AUTHORS.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef EOLIAN_CXX_CONTAINER_HH
17 #define EOLIAN_CXX_CONTAINER_HH
18 
19 #include "grammar/generator.hpp"
20 #include "grammar/klass_def.hpp"
21 #include "grammar/case.hpp"
22 #include "grammar/type.hpp"
23 
24 namespace efl { namespace eolian { namespace grammar {
25 
26 template <typename OutputIterator, typename Context>
generate_container(OutputIterator sink,attributes::complex_type_def const & complex,Context const & context,std::string const & name)27 void generate_container(OutputIterator sink, attributes::complex_type_def const& complex, Context const& context
28                         , std::string const& name)
29 {
30   if(!complex.subtypes.empty())
31     {
32       attributes::type_def subtype = complex.subtypes[0];
33       as_generator(" "<< name << "<" << type << ">").generate(sink, subtype, context);
34     }
35 }
36 
37 } } }
38 
39 #endif
40