| 1 |
/* |
| 2 |
* Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/> |
| 3 |
* (C) 2020 Vladimir Sadovnikov <[email protected]> |
| 4 |
* |
| 5 |
* This file is part of lsp-runtime-lib |
| 6 |
* Created on: 30 авг. 2019 г. |
| 7 |
* |
| 8 |
* lsp-runtime-lib is free software: you can redistribute it and/or modify |
| 9 |
* it under the terms of the GNU Lesser General Public License as published by |
| 10 |
* the Free Software Foundation, either version 3 of the License, or |
| 11 |
* any later version. |
| 12 |
* |
| 13 |
* lsp-runtime-lib is distributed in the hope that it will be useful, |
| 14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
* GNU Lesser General Public License for more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU Lesser General Public License |
| 19 |
* along with lsp-runtime-lib. If not, see <https://www.gnu.org/licenses/>. |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef LSP_PLUG_IN_FMT_JAVA_OBJECTSTREAMFIELD_H_ |
| 23 |
#define LSP_PLUG_IN_FMT_JAVA_OBJECTSTREAMFIELD_H_ |
| 24 |
|
| 25 |
#include <lsp-plug.in/runtime/version.h> |
| 26 |
#include <lsp-plug.in/runtime/LSPString.h> |
| 27 |
#include <lsp-plug.in/fmt/java/const.h> |
| 28 |
#include <lsp-plug.in/fmt/java/Object.h> |
| 29 |
#include <lsp-plug.in/fmt/java/String.h> |
| 30 |
|
| 31 |
namespace lsp |
| 32 |
{ |
| 33 |
namespace java |
| 34 |
{ |
| 35 |
class ObjectStreamField: public Object |
| 36 |
{ |
| 37 |
public: |
| 38 |
static const char *CLASS_NAME; |
| 39 |
|
| 40 |
private: |
| 41 |
friend class ObjectStream; |
| 42 |
ObjectStreamField & operator = (const ObjectStreamField &); |
| 43 |
|
| 44 |
protected: |
| 45 |
ftype_t enType; |
| 46 |
LSPString sName; |
| 47 |
String *pSignature; |
| 48 |
size_t nOffset; |
| 49 |
char *sRawName; |
| 50 |
|
| 51 |
public: |
| 52 |
explicit ObjectStreamField(); |
| 53 |
virtual ~ObjectStreamField(); |
| 54 |
|
| 55 |
public: |
| 56 |
inline ftype_t type() const { return enType; } |
| 57 |
inline const LSPString *name() const { return &sName; } |
| 58 |
inline const char *raw_name() const { return sRawName; } |
| 59 |
inline const LSPString *signature() const { return (pSignature != NULL) ? pSignature->string() : NULL; } |
| 60 |
inline const String *java_signature() const { return pSignature; } |
| 61 |
inline size_t size_of() const { return java::size_of(enType); }; |
| 62 |
inline size_t aligned_offset(size_t offset) const { return java::aligned_offset(offset, enType); }; |
| 63 |
inline bool is_reference() const { return java::is_reference(enType); } |
| 64 |
inline bool is_primitive() const { return java::is_primitive(enType); } |
| 65 |
inline size_t offset() const { return nOffset; } |
| 66 |
}; |
| 67 |
|
| 68 |
} /* namespace java */ |
| 69 |
} /* namespace lsp */ |
| 70 |
|
| 71 |
#endif /* LSP_PLUG_IN_FMT_JAVA_OBJECTSTREAMFIELD_H_ */ |