2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 * @file AthContainers/PackedContainer.icc
6 * @author scott snyder <snyder@bnl.gov>
8 * @brief Container to hold aux data to be stored in a packed form.
16 * @brief Metafunction to extract the innermost element type
17 * from a nested vector type.
19 * I.e., vector<vector<... <T> > should yield T.
26 template <class T, class ALLOC>
27 struct inner_type<std::vector<T, ALLOC> >
29 typedef typename inner_type<T>::type type;
36 * The packing parameters will be initialized to defaults appropriate
37 * for type @c T. (See @c PackedParameters.)
39 template <class T, class ALLOC>
41 PackedContainer<T, ALLOC>::PackedContainer()
42 : m_parms (static_cast<typename inner_type<T>::type>(0))
48 * @brief Set a packing option.
49 * @param option The option to set.
51 * Returns true on success, false otherwise.
53 * See @c PackedParameters::setOptions for details.
55 template <class T, class ALLOC>
57 bool PackedContainer<T, ALLOC>::setOption (const AuxDataOption& option)
59 return m_parms.setOption (option);
64 * @brief Set a packing option.
65 * @param name The option name.
66 * @param val The option value.
68 * Returns true on success, false otherwise.
70 * See @c PackedParameters::setOptions for details.
72 template <class T, class ALLOC>
74 bool PackedContainer<T, ALLOC>::setOption (const std::string& name, int val)
76 return this->setOption (SG::AuxDataOption (name, val));
81 * @brief Set a packing option.
82 * @param name The option name.
83 * @param val The option value.
85 * Returns true on success, false otherwise.
87 * See @c PackedParameters::setOptions for details.
89 template <class T, class ALLOC>
91 bool PackedContainer<T, ALLOC>::setOption (const std::string& name, float val)
93 return this->setOption (SG::AuxDataOption (name, val));
98 * @brief Set a packing option.
99 * @param name The option name.
100 * @param val The option value.
102 * Returns true on success, false otherwise.
104 * See @c PackedParameters::setOptions for details.
106 template <class T, class ALLOC>
108 bool PackedContainer<T, ALLOC>::setOption (const std::string& name, double val)
110 return this->setOption (SG::AuxDataOption (name, val));
115 * @brief Return the packing parameters for this container.
117 template <class T, class ALLOC>
119 const PackedParameters& PackedContainer<T, ALLOC>::parms() const
126 * @brief Set the packing parameters.
127 * @param parms The new packing parameters.
129 template <class T, class ALLOC>
131 void PackedContainer<T, ALLOC>::setParms (const PackedParameters& parms)