GPU-Calc: remove Alloc_Host_Ptr for clmem of NAN vector
[LibreOffice.git] / cli_ure / source / uno_bridge / cli_environment.h
blobe53e18121dd97d475ad06caa884dcc93b84a5b54
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_CLI_ENVIRONMENT_H
21 #define INCLUDED_CLI_ENVIRONMENT_H
23 #include "cli_base.h"
25 using namespace System;
26 using namespace System::Collections;
27 using namespace System::Runtime::Serialization;
29 namespace cli_uno
32 public ref class Cli_environment
34 static System::String^ sOidPart;
35 static Hashtable^ m_objects;
36 static System::Runtime::Serialization::ObjectIDGenerator^ m_IDGen;
37 inline static System::String^ createKey(System::String^ oid, System::Type^ t);
39 #if OSL_DEBUG_LEVEL >= 1
40 int _numRegisteredObjects;
41 #endif
43 static Cli_environment()
45 m_objects = Hashtable::Synchronized(gcnew Hashtable());
46 m_IDGen = gcnew System::Runtime::Serialization::ObjectIDGenerator();
47 System::Text::StringBuilder^ buffer = gcnew System::Text::StringBuilder(256);
48 Guid gd = Guid::NewGuid();
49 buffer->Append(";cli[0];");
50 buffer->Append(gd.ToString());
51 sOidPart = buffer->ToString();
54 public:
56 inline Cli_environment();
58 ~Cli_environment();
60 /**
61 Registers an UNO object as being mapped by this bridge. The resulting
62 cli object is represents all interfaces of the UNO object. Therefore the
63 object can be registered only with its OID; a type is not necessary.
65 Object^ registerInterface(Object^ obj, System::String^ oid);
66 /**
67 Registers a CLI object as being mapped by this bridge. The resulting
68 object represents exactly one UNO interface.
70 Object^ registerInterface(Object^ obj, System::String^ oid, System::Type^ type);
72 /**
73 By revoking an interface it is declared that the respective interface has
74 not been mapped. The proxy implementations call revoke interface in their
75 destructors.
77 inline void revokeInterface(System::String^ oid);
79 void revokeInterface(System::String^ oid, System::Type^ type);
80 /**
81 * Retrieves an interface identified by its object id and type from this
82 * environment.
84 * @param oid object id of interface to be retrieved
85 * @param type the type description of the interface to be retrieved
86 * @see com.sun.star.uno.IEnvironment#getRegisteredInterface
88 Object^ getRegisteredInterface(System::String^ oid, System::Type^ type);
90 /**
91 * Generates a worldwide unique object identifier (oid) for the given object. It is
92 * guaranteed, that subsequent calls to the method with the same object
93 * will give the same id.
94 * <p>
95 * @return the generated oid.
96 * @param object the object for which a Oid should be generated.
98 static System::String^ getObjectIdentifier(Object^ obj);
102 } //namespace cli_uno
105 #endif
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */