source: Sophya/trunk/SophyaExt/JThreadsC++/JTCSrc/JTC/MonitorT.h@ 1016

Last change on this file since 1016 was 1016, checked in by ansari, 25 years ago

Creation du module JThreadsC++, importation du code des classes
de Thread a la Java de Object Oriented Concepts Inc - Reza 19/5/2000

File size: 738 bytes
Line 
1// **********************************************************************
2//
3// Copyright (c) 2000
4// Object Oriented Concepts, Inc.
5// Billerica, MA, USA
6//
7// All Rights Reserved
8//
9// **********************************************************************
10
11#ifndef JTC_MONITOR_TEMPL_H_
12#define JTC_MONITOR_TEMPL_H_
13
14#include <JTC/Monitor.h>
15
16template <class T>
17class JTCMonitorT : public JTCMonitor
18{
19 T& obj_;
20
21public:
22
23 JTCMonitorT(T& obj)
24 : obj_(obj)
25 {
26 }
27
28 T& operator*()
29 {
30 return obj_;
31 }
32
33 const T& operator*() const
34 {
35 return obj_;
36 }
37
38 T* operator->()
39 {
40 return &obj_;
41 }
42
43 const T* operator->() const
44 {
45 return &obj_;
46 }
47
48 T& get()
49 {
50 return obj_;
51 }
52};
53
54#endif
Note: See TracBrowser for help on using the repository browser.