cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
svlStreamManager.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Balazs Vagvolgyi
7  Created on: 2006
8 
9  (C) Copyright 2006-2007 Johns Hopkins University (JHU), All Rights
10  Reserved.
11 
12 --- begin cisst license - do not edit ---
13 
14 This software is provided "as is" under an open source license, with
15 no warranty. The complete license can be found in license.txt and
16 http://www.cisst.org/cisst/license.txt.
17 
18 --- end cisst license ---
19 
20 */
21 
22 
23 #ifndef _svlStreamManager_h
24 #define _svlStreamManager_h
25 
28 
29 // Always include last!
31 
32 
33 // Forward declarations
34 class svlSyncPoint;
35 class svlFilterBase;
37 class svlStreamProc;
38 class osaThread;
39 class osaCriticalSection;
40 
41 
43 {
45 
46 friend class svlStreamProc;
47 
48 public:
50  svlStreamManager(unsigned int threadcount);
52 
53  int SetSourceFilter(svlFilterSourceBase * source);
54  int Initialize(void);
55  void Release(void);
56  bool IsInitialized(void) const;
57  int Play(void);
58  void Stop(void);
59  bool IsRunning(void) const;
60  int WaitForStop(double timeout = -1.0);
61  int GetStreamStatus(void) const;
62  void DisconnectAll(void);
63 
64  // Virtual methods from mtsComponent (these are temporary measures until
65  // ticket #67 is resolved)
66  void Start(void) { Play(); }
67  void Suspend(void) { Stop(); }
68 
69 private:
70  unsigned int ThreadCount;
71  vctDynamicVector<svlStreamProc*> StreamProcInstance;
72  vctDynamicVector<osaThread*> StreamProcThread;
73  svlSyncPoint* SyncPoint;
75 
76  svlFilterSourceBase* StreamSource;
77  bool Initialized;
78  bool Running;
79  bool StopThread;
80  int StreamStatus;
81 
82  void InternalStop(unsigned int callingthreadID);
83 
84 protected:
85  virtual void CreateInterfaces(void);
86  virtual void PlayCommand(void);
87  virtual void InitializeCommand(void);
88  virtual void SetSourceFilterCommand(const mtsStdString & source);
89 };
90 
92 
93 #endif // _svlStreamManager_h
94 
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
Definition: svlSyncPoint.h:32
Definition: osaCriticalSection.h:36
void Start(void)
Definition: svlStreamManager.h:66
Definition: svlFilterBase.h:39
Define a thread object.
Definition: osaThread.h:164
Definition: svlFilterSourceBase.h:38
CMN_DECLARE_SERVICES_INSTANTIATION(svlStreamManager)
void Initialize(void)
Declaration of mtsComponent.
Declaration of vctDynamicVector.
bool IsRunning(void) const
bool CISST_DEPRECATED Running(void) const
Definition: mtsComponent.h:428
Definition: mtsComponent.h:150
Definition: svlStreamProc.h:31
void Suspend(void)
Definition: svlStreamManager.h:67
Macros to export the symbols of cisstStereoVision (in a Dll).
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
Definition: svlStreamManager.h:42
const int CMN_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:331
#define CMN_LOG_ALLOW_DEFAULT
Definition: cmnLogLoD.h:76