Caffa  1.1.0
C++ Application Framework for Embedded Systems with introspection
cafFieldScriptingCapability.h
1 //##################################################################################################
2 //
3 // Custom Visualization Core library
4 // Copyright (C) Ceetron Solutions AS
5 //
6 // This library may be used under the terms of either the GNU General Public License or
7 // the GNU Lesser General Public License as follows:
8 //
9 // GNU General Public License Usage
10 // This library is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful, but WITHOUT ANY
16 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 // FITNESS FOR A PARTICULAR PURPOSE.
18 //
19 // See the GNU General Public License at <<http://www.gnu.org/licenses/gpl.html>>
20 // for more details.
21 //
22 // GNU Lesser General Public License Usage
23 // This library is free software; you can redistribute it and/or modify
24 // it under the terms of the GNU Lesser General Public License as published by
25 // the Free Software Foundation; either version 2.1 of the License, or
26 // (at your option) any later version.
27 //
28 // This library is distributed in the hope that it will be useful, but WITHOUT ANY
29 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
30 // FITNESS FOR A PARTICULAR PURPOSE.
31 //
32 // See the GNU Lesser General Public License at <<http://www.gnu.org/licenses/lgpl-2.1.html>>
33 // for more details.
34 //
35 //##################################################################################################
36 #pragma once
37 
38 #include "cafFieldCapability.h"
39 #include "cafFieldHandle.h"
40 
41 #include <string>
42 
43 namespace caffa
44 {
45 class FieldHandle;
46 class ObjectFactory;
47 class ObjectHandle;
48 
50 {
51 public:
52  FieldScriptingCapability( const std::string& scriptFieldName, bool readable = true, bool writeable = true );
53 
54  const std::string scriptFieldName() const;
55 
56  bool isReadable() const;
57  bool isWritable() const;
58  void setReadable( bool readable );
59  void setWritable( bool writable );
60 
61 protected:
62  const FieldHandle* owner() const override;
63  void setOwner( FieldHandle* field ) override;
64 
65 private:
66  std::string m_scriptFieldName;
67  bool m_readable;
68  bool m_writeable;
69 
70  FieldHandle* m_field;
71 };
72 
73 } // namespace caffa
Definition: cafFieldCapability.h:8
Base class for all fields, making it possible to handle them generically.
Definition: cafFieldHandle.h:23
Definition: cafFieldScriptingCapability.h:50
Main Caffa namespace.
Definition: __init__.py:1