ProgramOptions.cti
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
14 /** \file
15  \brief ProgramOptions inline template implementation */
16 
17 #include "ProgramOptions.ih"
18 
19 // Custom includes
20 
21 #define prefix_ inline
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
23 
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 // senf::console::detail::ProgramOptionsSource
26 
27 template <class Container>
28 prefix_ senf::console::detail::ProgramOptionsSource &
29 senf::console::detail::ProgramOptionsSource::nonOptions(Container & container)
30 {
31  nonOptions_.reset(new NonOptionContainerImpl<Container>(container));
32  return *this;
33 }
34 
35 //-/////////////////////////////////////////////////////////////////////////////////////////////////
36 // senf::console::detail::ProgramOptionsSource::NonOptionContainerImpl
37 
38 template <class Container>
39 prefix_
40 senf::console::detail::ProgramOptionsSource::NonOptionContainerImpl<Container>::
41 NonOptionContainerImpl(Container & c)
42  : c_ (c)
43 {}
44 
45 template <class Container>
46 prefix_ void
47 senf::console::detail::ProgramOptionsSource::NonOptionContainerImpl<Container>::clear()
48 {
49  c_.clear();
50 }
51 
52 template <class Container>
53 prefix_ void
54 senf::console::detail::ProgramOptionsSource::NonOptionContainerImpl<Container>::
55 push_back(std::string const & value)
56 {
57  c_.push_back(value);
58 }
59 
60 //-/////////////////////////////////////////////////////////////////////////////////////////////////
61 // senf::console::ProgramOptions
62 
63 template <class Container>
64 prefix_ senf::console::ProgramOptions &
65 senf::console::ProgramOptions::nonOptions(Container & container)
66 {
67  config_.nonOptions(container);
68  return *this;
69 }
70 
71 //-/////////////////////////////////////////////////////////////////////////////////////////////////
72 #undef prefix_
73 
74 
75 // Local Variables:
76 // mode: c++
77 // fill-column: 100
78 // comment-column: 40
79 // c-file-style: "senf"
80 // indent-tabs-mode: nil
81 // ispell-local-dictionary: "american"
82 // compile-command: "scons -u test"
83 // End: