-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCBarFoo.h
More file actions
34 lines (29 loc) · 799 Bytes
/
Copy pathCBarFoo.h
File metadata and controls
34 lines (29 loc) · 799 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
#pragma once
#include <Meta.hpp>
#include "IFooBar.h"
class CBarFoo : public IFooBar
{
int barFooNum = 0; // CMeta::TBarFooNum
public:
struct CMeta
{
using TMode = Meta::EResourceAccessMode;
// Resource definitions
template <TMode Mode>
using TBarFooNum = Meta::CResourceAccess<^^CBarFoo::barFooNum, Mode>;
// Method definitions
using TAbstractMethod = Meta::CMethodResources<TBarFooNum<TMode::READ>>;
using TVirtualMethod = Meta::CMethodResources<IFooBar::CMeta::TFooBarNum<TMode::READ>>;
};
~CBarFoo() override = default;
[[=CMeta::TAbstractMethod{}]]
int AbstractMethod() override
{
return barFooNum; // read access CBarFoo::barFooNum
}
[[=CMeta::TVirtualMethod{}]]
int VirtualMethod() override
{
return fooBarNum; // read access IFooBar::fooBarNum
}
};