LibreOffice: cppu/Enterable.hxx Source File

LibreOffice LibreOffice 26.2 SDK C/C++ API Reference

Loading...
Searching...
No Matches
Enterable.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20/*
21 * This file is part of LibreOffice published API.
22 */
23
24#ifndef INCLUDED_CPPU_ENTERABLE_HXX
25#define INCLUDED_CPPU_ENTERABLE_HXX
26
27#include "uno/Enterable.h"
28#include "rtl/ustring.hxx"
29
30 namespace cppu
31{
38 class Enterable : public uno_Enterable
39{
40public:
41 /* These methods need to be implemented in a derived class.
42 */
43 virtual void v_enter() = 0;
44 virtual void v_leave() = 0;
45 virtual void v_callInto_v(uno_EnvCallee * pCallee, va_list * pParam) = 0;
46 virtual void v_callOut_v (uno_EnvCallee * pCallee, va_list * pParam) = 0;
47 virtual bool v_isValid (rtl::OUString * pReason) = 0;
48
49 virtual ~Enterable() {}
50
51public:
52 inline explicit Enterable();
53
54 void enter() {m_enter(this);}
55 void leave() {m_leave(this);}
56
57 void callInto_v(uno_EnvCallee * pCallee, va_list * pParam) {m_callInto_v(this, pCallee, pParam);}
58 void callOut_v (uno_EnvCallee * pCallee, va_list * pParam) {m_callOut_v (this, pCallee, pParam);}
59
60 inline void callInto(uno_EnvCallee * pCallee, ...);
61 inline void callOut (uno_EnvCallee * pCallee, ...);
62
63 int isValid (rtl::OUString * pReason) {return m_isValid(this, &pReason->pData);}
64
65private:
66 Enterable(Enterable const &) SAL_DELETED_FUNCTION;
67 Enterable & operator = (Enterable const &) SAL_DELETED_FUNCTION;
68};
69
70 extern "C" inline void Enterable_call_enter (void * context) { static_cast<Enterable *>(context)->v_enter(); }
71 extern "C" inline void Enterable_call_leave (void * context) { static_cast<Enterable *>(context)->v_leave(); }
72 extern "C" inline void Enterable_call_callInto_v(void * context, uno_EnvCallee * pCallee, va_list * pParam)
73 { static_cast<Enterable *>(context)->v_callInto_v(pCallee, pParam); }
74 extern "C" inline void Enterable_call_callOut_v (void * context, uno_EnvCallee * pCallee, va_list * pParam)
75 { static_cast<Enterable *>(context)->v_callOut_v(pCallee, pParam); }
76 extern "C" inline int Enterable_call_isValid (void * context, rtl_uString ** pReason)
77 {return static_cast<Enterable *>(context)->v_isValid(reinterpret_cast<rtl::OUString *>(pReason));}
78
79
80Enterable::Enterable()
81{
82 m_enter = Enterable_call_enter;
83 m_leave = Enterable_call_leave;
84 m_callInto_v = Enterable_call_callInto_v;
85 m_callOut_v = Enterable_call_callOut_v;
86 m_isValid = Enterable_call_isValid;
87}
88
89 void Enterable::callInto(uno_EnvCallee * pCallee, ...)
90{
91 va_list param;
92
93 va_start(param, pCallee);
94 callInto_v(pCallee, &param);
95 va_end(param);
96}
97
98 void Enterable::callOut(uno_EnvCallee * pCallee, ...)
99{
100 va_list param;
101
102 va_start(param, pCallee);
103 callOut_v(pCallee, &param);
104 va_end(param);
105}
106
107}
108
109
110#endif
111
112/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DELETED_FUNCTION
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition types.h:396
ustring.hxx
Enterable.h
uno_EnvCallee
void uno_EnvCallee(va_list *pParam)
Typedef for variable argument function.
Definition environment.h:342
cppu
Definition Enterable.hxx:31
cppu::Enterable_call_enter
void Enterable_call_enter(void *context)
Definition Enterable.hxx:70
cppu::Enterable_call_isValid
int Enterable_call_isValid(void *context, rtl_uString **pReason)
Definition Enterable.hxx:76
cppu::Enterable_call_callInto_v
void Enterable_call_callInto_v(void *context, uno_EnvCallee *pCallee, va_list *pParam)
Definition Enterable.hxx:72
cppu::Enterable_call_leave
void Enterable_call_leave(void *context)
Definition Enterable.hxx:71
cppu::Enterable_call_callOut_v
void Enterable_call_callOut_v(void *context, uno_EnvCallee *pCallee, va_list *pParam)
Definition Enterable.hxx:74
rtl::OUString
This String class provides base functionality for C++ like Unicode character array handling.
Definition ustring.hxx:172
uno_Enterable
A struct pReserved needs to point to, if implementing a purpose environment.
Definition Enterable.h:94
uno_Enterable::m_enter
uno_Enterable_enter * m_enter
Definition Enterable.h:95
uno_Enterable::m_isValid
uno_Enterable_isValid_v * m_isValid
Definition Enterable.h:99
uno_Enterable::m_callOut_v
uno_Enterable_callOut_v * m_callOut_v
Definition Enterable.h:98
uno_Enterable::m_callInto_v
uno_Enterable_callInto_v * m_callInto_v
Definition Enterable.h:97
uno_Enterable::m_leave
uno_Enterable_leave * m_leave
Definition Enterable.h:96
cppu::Enterable
C++ wrapper for binary C Enterable (http://wiki.openoffice.org/wiki/Uno/Cpp/Spec/Environment_Stack).
Definition Enterable.hxx:39
cppu::Enterable::v_enter
virtual void v_enter()=0
cppu::Enterable::v_isValid
virtual bool v_isValid(rtl::OUString *pReason)=0
cppu::Enterable::v_callOut_v
virtual void v_callOut_v(uno_EnvCallee *pCallee, va_list *pParam)=0
cppu::Enterable::enter
void enter()
Definition Enterable.hxx:54
cppu::Enterable::v_leave
virtual void v_leave()=0
cppu::Enterable::leave
void leave()
Definition Enterable.hxx:55
cppu::Enterable::callInto
void callInto(uno_EnvCallee *pCallee,...)
Definition Enterable.hxx:89
cppu::Enterable::callOut
void callOut(uno_EnvCallee *pCallee,...)
Definition Enterable.hxx:98
cppu::Enterable::isValid
int isValid(rtl::OUString *pReason)
Definition Enterable.hxx:63
cppu::Enterable::v_callInto_v
virtual void v_callInto_v(uno_EnvCallee *pCallee, va_list *pParam)=0
cppu::Enterable::callOut_v
void callOut_v(uno_EnvCallee *pCallee, va_list *pParam)
Definition Enterable.hxx:58
cppu::Enterable::Enterable
Enterable()
Definition Enterable.hxx:80
cppu::Enterable::callInto_v
void callInto_v(uno_EnvCallee *pCallee, va_list *pParam)
Definition Enterable.hxx:57
cppu::Enterable::~Enterable
virtual ~Enterable()
Definition Enterable.hxx:49