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 namespace nx {
6 namespace sdk {
7 
8 template<typename IItem>
9 class IList: public Interface<IList<IItem>>
10 {
11 public:
12  static auto interfaceId()
13  {
14  return IList::template makeIdForTemplate<IList<IItem>, IItem>("nx::sdk::IList");
15  }
16 
17  virtual int count() const = 0;
18 
20  protected: virtual IItem* getAt(int index) const = 0;
21  public: Ptr<IItem> at(int index) const { return toPtr(getAt(index)); }
22 };
23 
24 } // namespace sdk
25 } // namespace nx
Definition: interface.h:28
virtual IItem * getAt(int index) const =0
Definition: ptr.h:18
Definition: apple_utils.h:6
Definition: i_list.h:9