nx_metadata_sdk  1.0
Metadata SDK
i_list.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2 
3 #pragma once
4 
5 #include "interface.h"
6 
7 namespace nx::sdk {
8 
9 template<typename IItem>
10 class IList: public Interface<IList<IItem>>
11 {
12 public:
13  static auto interfaceId()
14  {
15  return IList::template makeIdForTemplate<IList<IItem>, IItem>("nx::sdk::IList");
16  }
17 
18  virtual int count() const = 0;
19 
21  protected: virtual IItem* getAt(int index) const = 0;
23  public: Ptr<IItem> at(int index) const { return Ptr(getAt(index)); }
24 };
25 template<typename IItem>
26 using IList0 = IList<IItem>;
27 
28 } // namespace nx::sdk
Ptr< IItem > at(int index) const
Definition: i_list.h:23
Definition: interface.h:48
virtual IItem * getAt(int index) const =0
Definition: ptr.h:18
Definition: device_agent.h:12
Definition: i_list.h:10