ACF $AcfVersion:0$
CExample.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
6#include <istd/IPolymorphic.h>
8
9
10namespace myNamespace
11{
12
13
19{
20public:
21 virtual int GetValue() const = 0;
22};
23
24
28class CExample: public icomp::CComponentBase, virtual public ITestInterface
29{
30 typedef CComponentBase BaseClass; // OBLIGATORY definition of component base class type as 'BaseClass'
31
32 // initialize all component attributes and references
33 I_BEGIN_COMPONENT(CExample);
34 I_REGISTER_INTERFACE(ITestInterface);
35 I_ASSIGN(m_value, "Value", "Test of attribute", false, 0);
36 I_ASSIGN_MULTI_0(m_valueList, "ValueList", "Test of attribute list", false);
37 I_ASSIGN(m_cloneableRef, "Cloneable", "Test of reference", false, "Cloneable");
38 I_ASSIGN_MULTI_0(m_cloneableListRef, "CloneableList", "Test of reference list", false);
39 I_ASSIGN(m_cloneableFact, "CloneableFactory", "Test of factory", false, "CloneableFactory");
40 I_ASSIGN_MULTI_0(m_cloneableListFact, "CloneableFactoryList", "Test of factory list", false);
41 I_END_COMPONENT;
42
43public:
45
46private:
50 I_ATTR(int, m_value);
54 I_MULTIATTR(int, m_valueList);
58 I_REF(ITestInterface, m_cloneableRef);
62 I_MULTIREF(ITestInterface, m_cloneableListRef);
66 I_FACT(ITestInterface, m_cloneableFact);
70 I_MULTIFACT(ITestInterface, m_cloneableListFact);
71};
72
73
74} // namespace myNamespace
75
76
77
78
Base class for component implementation.
CComponentBase()
Create component and assign it to specific context.
Base interface for all used interfaces and implementations.
Demonstrate using of all elements of component concept.
Definition CExample.h:29
This is example interface only.
Definition CExample.h:19
virtual int GetValue() const =0