Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleInterface.cpp
More file actions
Latest commit
80 lines (65 loc) · 2.68 KB
/
Copy pathModuleInterface.cpp
File metadata and controls
80 lines (65 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
///////////////////////////////////////////////////////////////////////////////
// FILE: ModuleInterface.cpp
// PROJECT: Micro-Manager
// SUBSYSTEM: MMDevice - Device adapter kit
//-----------------------------------------------------------------------------
// DESCRIPTION: The implementation for the common plugin functions
// AUTHOR: Nenad Amodaj, nenad@amodaj.com, 08/08/2005
// NOTE: Change the implementation of module interface methods in
// this file with caution, since the Micro-Manager plugin
// mechanism relies on specific functionality as implemented
// here.
// COPYRIGHT: University of California, San Francisco, 2006
// LICENSE: This file is distributed under the BSD license.
// License text is included with the source distribution.
//
// This file is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
#include"ModuleInterface.h"
#include"RegisteredDeviceCollection.h"
#ifndef MMDEVICE_CLIENT_BUILD
#include<algorithm>
#include<string>
#include<vector>
namespace {
// Registered devices in this module (device adapter library)
MM::internal::RegisteredDeviceCollection& TheRegisteredDeviceCollection()
{
staticMM::internal::RegisteredDeviceCollection devices;
return devices;
}
} // anonymous namespace
MODULE_APIlongGetModuleVersion()
{
returnMODULE_INTERFACE_VERSION;
}
MODULE_APIlongGetDeviceInterfaceVersion()
{
returnDEVICE_INTERFACE_VERSION;
}
MODULE_APIunsignedGetNumberOfDevices()
{
returnTheRegisteredDeviceCollection().GetNumberOfDevices();
}
MODULE_APIboolGetDeviceName(unsigned deviceIndex, char* name, unsigned bufLen)
{
returnTheRegisteredDeviceCollection().GetDeviceName(deviceIndex, name, bufLen);
}
MODULE_APIboolGetDeviceType(constchar* deviceName, int* type)
{
returnTheRegisteredDeviceCollection().GetDeviceType(deviceName, type);
}
MODULE_APIboolGetDeviceDescription(constchar* deviceName, char* description, unsigned bufLen)
{
returnTheRegisteredDeviceCollection().GetDeviceDescription(deviceName, description, bufLen);
}
voidRegisterDevice(constchar* deviceName, MM::DeviceType deviceType, constchar* deviceDescription)
{
TheRegisteredDeviceCollection().RegisterDevice(deviceName, deviceType, deviceDescription);
}
#endif// MMDEVICE_CLIENT_BUILD