-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCFooBar.h
More file actions
37 lines (31 loc) · 978 Bytes
/
Copy pathCFooBar.h
File metadata and controls
37 lines (31 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include <Meta.hpp>
#include "IFooBar.h"
class CFooBar : public IFooBar
{
int otherFooBarNum = 0; // CMeta::TOtherFooBarNum
public:
struct CMeta
{
using TMode = Meta::EResourceAccessMode;
// Resource definitions
template <TMode Mode>
using TOtherFooBarNum = Meta::CResourceAccess<^^CFooBar::otherFooBarNum, Mode>;
// Method definitions
using TAbstractMethod = Meta::CMethodResources<IFooBar::CMeta::TFooBarNum<TMode::READ>>;
using TVirtualMethod = Meta::CMethodResources<TOtherFooBarNum<TMode::WRITE>,
IFooBar::CMeta::TFooBarNum<TMode::READ>>;
};
~CFooBar() override = default;
[[=CMeta::TAbstractMethod{}]]
int AbstractMethod() override
{
return fooBarNum; // read access IFooBar::fooBarNum
}
[[=CMeta::TVirtualMethod{}]]
int VirtualMethod() override
{
otherFooBarNum = 1; // write access CFooBar::otherFooBarNum
return fooBarNum; // read access IFooBar::fooBarNum
}
};