nx_server_plugin_sdk 1.0 Server Plugin 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
nx::sdk::IList::at
Ptr< IItem > at(int index) const
Definition: i_list.h:23
nx::sdk::Interface
Definition: interface.h:48
nx::sdk::IList::getAt
virtual IItem * getAt(int index) const =0
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk
Definition: device_agent.h:12
nx::sdk::IList
Definition: i_list.h:10