xref: /trunk/main/binaryurp/source/binaryany.hxx (revision 3638366c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_BINARYURP_SOURCE_BINARYANY_HXX
25 #define INCLUDED_BINARYURP_SOURCE_BINARYANY_HXX
26 
27 #include "sal/config.h"
28 
29 #include "uno/any2.h"
30 
31 namespace com { namespace sun { namespace star { namespace uno {
32     class TypeDescription;
33 } } } }
34 
35 namespace binaryurp {
36 
37 class BinaryAny {
38 public:
39     BinaryAny() throw ();
40 
41     BinaryAny(com::sun::star::uno::TypeDescription const & type, void * value)
42         throw ();
43 
44     explicit BinaryAny(uno_Any const & raw) throw ();
45         // takes over raw.pData (but copies raw.pType); raw must not be passed
46         // to uno_any_destruct
47 
48     BinaryAny(BinaryAny const & other) throw ();
49 
50     ~BinaryAny() throw ();
51 
52     BinaryAny & operator =(BinaryAny const & other) throw ();
53 
54     uno_Any * get() throw ();
55 
56     com::sun::star::uno::TypeDescription getType() const throw ();
57 
58     void * getValue(com::sun::star::uno::TypeDescription const & type) const
59         throw ();
60 
61 private:
62     mutable uno_Any data_;
63         // mutable so that getValue() can return a non-const void *, as in turn
64         // required at various places in binary UNO
65 };
66 
67 }
68 
69 #endif
70