1 |
/* avdevicepool.cpp |
---|
2 |
* Copyright (C) 2004 by Daniel Wagner |
---|
3 |
* |
---|
4 |
* This file is part of FreeBob. |
---|
5 |
* |
---|
6 |
* FreeBob is free software; you can redistribute it and/or modify |
---|
7 |
* it under the terms of the GNU General Public License as published by |
---|
8 |
* the Free Software Foundation; either version 2 of the License, or |
---|
9 |
* (at your option) any later version. |
---|
10 |
* FreeBob is distributed in the hope that it will be useful, |
---|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 |
* GNU General Public License for more details. |
---|
14 |
* |
---|
15 |
* You should have received a copy of the GNU General Public License |
---|
16 |
* along with FreeBob; if not, write to the Free Software |
---|
17 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
---|
18 |
* MA 02111-1307 USA. |
---|
19 |
*/ |
---|
20 |
|
---|
21 |
#include "avdevicepool.h" |
---|
22 |
|
---|
23 |
AvDevicePool::AvDevicePool() |
---|
24 |
{ |
---|
25 |
} |
---|
26 |
|
---|
27 |
AvDevicePool::~AvDevicePool() |
---|
28 |
{ |
---|
29 |
} |
---|
30 |
|
---|
31 |
FBReturnCodes |
---|
32 |
AvDevicePool::registerAvDevice(AvDevice* pAvDevice) |
---|
33 |
{ |
---|
34 |
m_avDevices.push_back( pAvDevice ); |
---|
35 |
return eFBRC_Success; |
---|
36 |
} |
---|
37 |
|
---|
38 |
|
---|
39 |
FBReturnCodes |
---|
40 |
AvDevicePool::unregisterAvDevice(AvDevice* pAvDevice) |
---|
41 |
{ |
---|
42 |
AvDeviceVector::iterator iter; |
---|
43 |
for ( iter = m_avDevices.begin(); |
---|
44 |
iter != m_avDevices.end(); |
---|
45 |
++iter ) |
---|
46 |
{ |
---|
47 |
if ( ( *iter ) == pAvDevice ) { |
---|
48 |
m_avDevices.erase( iter ); |
---|
49 |
return eFBRC_Success; |
---|
50 |
} |
---|
51 |
} |
---|
52 |
|
---|
53 |
if ( iter == m_avDevices.end() ) { |
---|
54 |
return eFBRC_AvDeviceNotFound; |
---|
55 |
} |
---|
56 |
|
---|
57 |
return eFBRC_Success; |
---|
58 |
} |
---|
59 |
|
---|