ctkServiceRegistrationPrivate.h

Go to the documentation of this file.
00001 /*=============================================================================
00002 
00003   Library: CTK
00004 
00005   Copyright (c) 2010 German Cancer Research Center,
00006     Division of Medical and Biological Informatics
00007 
00008   Licensed under the Apache License, Version 2.0 (the "License");
00009   you may not use this file except in compliance with the License.
00010   You may obtain a copy of the License at
00011 
00012     http://www.apache.org/licenses/LICENSE-2.0
00013 
00014   Unless required by applicable law or agreed to in writing, software
00015   distributed under the License is distributed on an "AS IS" BASIS,
00016   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017   See the License for the specific language governing permissions and
00018   limitations under the License.
00019 
00020 =============================================================================*/
00021 
00022 
00023 #ifndef CTKSERVICEREGISTRATIONPRIVATE_H
00024 #define CTKSERVICEREGISTRATIONPRIVATE_H
00025 
00026 #include <QHash>
00027 #include <QMutex>
00028 
00029 #include "ctkServiceReference.h"
00030 
00031 
00032   class ctkPluginPrivate;
00033   class ctkServiceRegistration;
00034 
00035   class ctkServiceRegistrationPrivate
00036   {
00037 
00038   protected:
00039 
00040     ctkServiceRegistration* const q_ptr;
00041 
00045     QObject* service;
00046 
00047   public:
00048 
00049     Q_DECLARE_PUBLIC(ctkServiceRegistration);
00050 
00051 
00055     ctkPluginPrivate* plugin;
00056 
00060     ctkServiceReference* reference;
00061 
00065     ServiceProperties properties;
00066 
00071     QHash<ctkPlugin*,int> dependents;
00072 
00076     QHash<ctkPlugin*, QObject*> serviceInstances;
00077 
00082     volatile bool available;
00083 
00089     volatile bool unregistering;
00090 
00094     QMutex eventLock;
00095 
00096     QMutex propsLock;
00097 
00098     ctkServiceRegistrationPrivate(ctkServiceRegistration* sr, ctkPluginPrivate* plugin, QObject* service,
00099                                const ServiceProperties& props);
00100 
00101     virtual ~ctkServiceRegistrationPrivate();
00102 
00109     bool isUsedByPlugin(ctkPlugin* p);
00110 
00111     virtual QObject* getService();
00112 
00113   };
00114 
00115 
00116 #endif // CTKSERVICEREGISTRATIONPRIVATE_H
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines