|
|
|||
File indexing completed on 2025-12-13 10:20:53
0001 #ifndef PODIO_DETAIL_ORDERKEY_H 0002 #define PODIO_DETAIL_ORDERKEY_H 0003 #include <functional> 0004 namespace podio::detail { 0005 /// Internal class allowing datatype objects to be placed in data structures like maps and sets by providing a way to 0006 /// compare them. The comparison is based on addresses of their internal data objects. 0007 /// 0008 /// This class is intended to be used as the return value of internal `podio::detail::getOrderKey` free functions. These 0009 /// functions are friends of each datatype, allowing them to access the internal data objects and define less-than 0010 /// comparison operators for both datatypes and interface types. 0011 /// 0012 /// The friend free function design is used in order to reduce the coupling between interfaces and datatypes. Interfaces 0013 /// do not need to be friends of datatypes to define the less-than comparison operator, which allows using datatypes 0014 /// from different datamodels in an interface type. 0015 class OrderKey { 0016 public: 0017 OrderKey(const void* orderKey) noexcept : m_orderKey(orderKey) { 0018 } 0019 friend bool operator<(const OrderKey& lhs, const OrderKey& rhs) noexcept { 0020 return std::less<const void*>{}(lhs.m_orderKey, rhs.m_orderKey); 0021 } 0022 0023 private: 0024 const void* m_orderKey; 0025 }; 0026 } // namespace podio::detail 0027 0028 #endif // PODIO_DETAIL_ORDERKEY_H
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|