|
AJA NTV2 SDK
17.0.1.1246
NTV2 SDK 17.0.1.1246
|
Go to the documentation of this file.
8 #ifndef NTV2NUBACCESS_H
9 #define NTV2NUBACCESS_H
50 inline size_t size (
void)
const {
return mDict.size();}
52 inline bool empty (
void)
const {
return mDict.empty();}
53 inline bool hasKey (
const std::string & inKey)
const {
return mDict.find(inKey) != mDict.end();}
54 std::string valueForKey (
const std::string & inKey)
const;
55 uint16_t u16ValueForKey (
const std::string & inKey,
const uint16_t inDefault = 0)
const;
57 size_t largestKeySize (
void)
const;
58 size_t largestValueSize (
void)
const;
59 std::ostream & Print (std::ostream & oss,
const bool inCompact =
true)
const;
65 inline void clear (
void) {mDict.clear();}
67 inline bool insert (
const std::string & inKey,
const std::string & inValue) {mDict[inKey] = inValue;
return true;}
68 inline size_t erase (
const std::string & inKey) {
return mDict.erase(inKey);}
74 typedef std::map<std::string, std::string>
Dict;
96 static bool IsSupportedScheme (
const std::string & inScheme);
100 void Reset (
const std::string inSpec =
"");
101 inline const std::string & DeviceSpec (
void)
const {
return mSpec;}
102 inline bool HasDeviceSpec (
void)
const {
return !DeviceSpec().empty();}
103 inline bool Successful (
void)
const {
return !Failed();}
104 inline bool Failed (
void)
const {
return DeviceSpec().empty() ?
true : HasErrors();}
108 inline size_t ErrorCount (
void)
const {
return mErrors.size();}
109 inline bool HasErrors (
void)
const {
return ErrorCount() > 0;}
110 inline std::string Error (
const size_t inIndex = 0)
const {
if (inIndex < mErrors.size())
return mErrors.at(inIndex);
return "";}
113 inline bool HasResult (
const std::string & inKey)
const {
return mResult.hasKey(inKey);}
114 std::string Result (
const std::string & inKey)
const {
return mResult.
valueForKey(inKey);}
115 std::string Resource (
const bool inStripLeadSlash =
true)
const;
116 std::ostream & PrintErrors (std::ostream & oss)
const;
117 std::ostream & Print (std::ostream & oss,
const bool inDumpResults =
false)
const;
118 std::string InfoString (
void)
const;
119 uint64_t DeviceSerial (
void)
const;
122 UWord DeviceIndex (
void)
const;
123 inline const NTV2Dictionary & QueryParams (
void)
const {
return mQueryParams;}
124 inline std::string QueryParam (
const std::string & inKey)
const {
return mQueryParams.
valueForKey(inKey);}
126 static void test (
void);
127 #endif // defined(_DEBUG)
131 bool ParseHexNumber (
size_t & pos, std::string & outToken);
132 bool ParseDecNumber (
size_t & pos, std::string & outToken);
133 bool ParseAlphaNumeric (
size_t & pos, std::string & outToken,
const std::string & inOtherChars =
"");
134 bool ParseScheme (
size_t & pos, std::string & outToken);
135 bool ParseSerialNum (
size_t & pos, std::string & outToken);
136 bool ParseDeviceID (
size_t & pos, std::string & outToken);
137 bool ParseModelName (
size_t & pos, std::string & outToken);
138 bool ParseDNSName (
size_t & pos, std::string & outDNSName);
139 bool ParseIPv4Address (
size_t & pos, std::string & outIPv4);
140 bool ParseHostAddressAndPortNumber (
size_t & pos, std::string & outAddr, std::string & outPort);
141 bool ParseResourcePath (
size_t & pos, std::string & outRsrc);
142 bool ParseParamAssignment (
size_t & pos, std::string & outKey, std::string & outValue);
144 inline int LargestResultKey (
void)
const {
return int(mResult.largestKeySize());}
145 inline int LargestResultValue (
void)
const {
return int(mResult.largestValueSize());}
146 inline char CharAt (
const size_t inPos) {
return inPos < mSpec.length() ? mSpec.at(inPos) : 0;}
147 inline size_t SpecLength (
void)
const {
return mSpec.length();}
148 inline size_t CurrentPosition (
void)
const {
return mPos;}
149 inline void AddError (
const std::string & inError) {mErrors.push_back(inError);}
150 static bool IsUpperLetter (
const char inChar);
151 static bool IsLowerLetter (
const char inChar);
152 static bool IsLetter (
const char inChar,
const bool inIncludeUnderscore =
false);
153 static bool IsDecimalDigit (
const char inChar);
154 static bool IsHexDigit (
const char inChar);
155 static bool IsLegalSerialNumChar (
const char inChar);
185 virtual std::string HostName (
void)
const {
return ConnectParam(
kConnectParamHost);}
187 virtual std::string Name (
void)
const {
return "";}
188 virtual std::string Description (
void)
const;
189 virtual std::ostream & Print (std::ostream & oss)
const;
195 virtual bool NTV2Connect (
void);
197 virtual bool NTV2Disconnect (
void);
198 virtual bool IsConnected (
void)
const {
return false;}
204 virtual const NTV2ConnectParams & ConnectParams (
void)
const {
return mConnectParams;}
206 virtual bool HasConnectParam (
const std::string & inParam)
const {
return mConnectParams.hasKey(inParam);}
207 virtual std::string ConnectParam (
const std::string & inParam)
const {
return mConnectParams.
valueForKey(inParam);}
209 virtual bool SetConnectParams (
const NTV2ConnectParams & inNewParams,
const bool inAugment =
false);
215 virtual bool NTV2ReadRegisterRemote (
const ULWord regNum,
ULWord & outRegValue,
const ULWord regMask,
const ULWord regShift);
217 virtual bool NTV2WriteRegisterRemote (
const ULWord regNum,
const ULWord regValue,
const ULWord regMask,
const ULWord regShift);
220 virtual bool NTV2DMATransferRemote (
const NTV2DMAEngine inDMAEngine,
const bool inIsRead,
222 const ULWord inCardOffsetBytes,
const ULWord inNumSegments,
223 const ULWord inSegmentHostPitch,
const ULWord inSegmentCardPitch,
224 const bool inSynchronous);
225 virtual bool NTV2MessageRemote (
NTV2_HEADER * pInMessage);
231 virtual bool NTV2GetBoolParamRemote (
const ULWord inParamID,
ULWord & outValue);
233 virtual bool NTV2GetNumericParamRemote (
const ULWord inParamID,
ULWord & outValue);
234 virtual bool NTV2GetSupportedRemote (
const ULWord inEnumsID,
ULWordSet & outSupported);
255 #if !defined(NTV2_DEPRECATE_16_3) // These functions are going away
257 virtual bool NTV2DriverGetBuildInformationRemote (
BUILD_INFO_STRUCT & buildInfo);
259 const UWord signalMask,
const bool testPatDMAEnb,
const ULWord testPatNum);
260 virtual bool NTV2ReadRegisterMultiRemote (
const ULWord numRegs,
ULWord & outFailedRegNum,
NTV2RegInfo outRegs[]);
261 virtual bool NTV2GetDriverVersionRemote (
ULWord & outDriverVersion);
262 #endif // !defined(NTV2_DEPRECATE_16_3)
265 virtual bool NTV2OpenRemote (
void);
266 virtual bool NTV2CloseRemote (
void);
270 uint32_t mSpare[1024];
307 virtual std::ostream & Print (std::ostream & oss)
const;
314 virtual const NTV2ConfigParams & ConfigParams (
void)
const {
return mConfigParams;}
316 virtual bool HasConfigParam (
const std::string & inParam)
const {
return mConfigParams.hasKey(inParam);}
317 virtual std::string ConfigParam (
const std::string & inParam)
const {
return mConfigParams.
valueForKey(inParam);}
318 virtual bool SetConfigParams (
const NTV2ConfigParams & inNewParams,
const bool inAugment =
false);
324 virtual void RunServer (
void);
334 uint32_t mSpare[1024];
365 #if !defined(NTV2_DEPRECATE_16_3) // Don't use these functions going forward
366 typedef NTV2RPCAPI* (*fpCreateNTV2SoftwareDevice) (
void * ,
const std::string & ,
const uint32_t );
367 #endif // !defined(NTV2_DEPRECATE_16_3)
370 #endif // NTV2NUBACCESS_H
NTV2Dictionary NTV2ConfigParams
A dictionary of parameters used to configure an RPC server.
enum _INTERRUPT_ENUMS_ INTERRUPT_ENUMS
std::pair< NTV2DeviceID, ULWord64 > NTV2DeviceIDSerialPair
Identifies a device by its NTV2DeviceID and serial number.
std::set< std::string > NTV2StringSet
static const std::string kConnectParamResource("ResourcePath")
Resource path – everything past URL [scheme://host[:port]/], excluding [?query].
NTV2Channel
These enum values are mostly used to identify a specific Frame Store. They're also commonly used to i...
A generic user-space buffer object that has an address and a length. Used most often to share an arbi...
static const std::string kConnectParamDevModel("DeviceModel")
First device of this model (e.g. 'kona4')
Base class of objects that can serve device operation RPCs with NTV2RPCClientAPI instances.
NTV2DeviceIDSerialPairs::const_iterator NTV2DeviceIDSerialPairsConstIter
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
NTV2FrameBufferFormat
Identifies a particular video frame buffer format. See Device Frame Buffer Formats for details.
std::ostream & Print(std::ostream &oss, const bool inCompact=true) const
Prints human-readable representation to ostream.
NTV2ConnectParams mConnectParams
Copy of connection parameters passed in to NTV2Connect.
static const std::string kConnectParamDevID("DeviceID")
First device having this ID (e.g. '0x10518400')
std::string DeviceModel(void) const
NTV2RPCClientAPI NTV2RPCAPI
virtual bool NTV2QueryDevices(NTV2StringList &outDeviceInfos)
Queries the devices that are accessible on the remote host.
static const std::string kConnectParamDevIndex("DeviceIndex")
Device having this index number.
std::set< ULWord > ULWordSet
A collection of unique ULWord (uint32_t) values.
NTV2Dictionary NTV2ConnectParams
A dictionary of parameters used to connect to remote/fake devices.
std::vector< NTV2DeviceIDSerialPair > NTV2DeviceIDSerialPairs
An ordered sequence of NTV2DeviceIDSerialPairs.
virtual std::ostream & Print(std::ostream &oss) const
static const std::string kConnectParamHost("Host")
DNS name, IPv4 or sw device DLL name.
All new NTV2 structs start with this common header.
static const std::string kConnectParamQuery("Query")
Query – everything past '?' in URL.
static const std::string kFuncNameCreateServer("CreateServer")
Create an NTV2RPCServerAPI instance.
Declares numerous NTV2 utility functions.
static const std::string kConnectParamDevSerial("DeviceSerial")
Device with this serial number.
NTV2ConfigParams mConfigParams
Copy of config params passed in to my constructor.
Dict::const_iterator DictConstIter
static const std::string kFuncNameCreateClient("CreateClient")
Create an NTV2RPCClientAPI instance.
std::vector< std::string > NTV2StringList
One-stop shop for parsing device specifications. (New in SDK 16.3) I do very little in the way of val...
std::pair< std::string, std::string > NTV2DictEntry
std::pair< std::string, std::string > NTV2DictionaryEntry
std::pair< std::string, std::string > NTV2ConnectParam
A parameter used to connect to remote/fake devices.
NTV2DeviceIDSerialPairs::iterator NTV2DeviceIDSerialPairsIter
static const std::string kLegalSchemeNTV2Local("ntv2local")
virtual std::ostream & Print(std::ostream &oss) const
static const std::string kLegalSchemeNTV2("ntv2")
Base class of objects that can connect to, and operate remote or fake devices. I have three general A...
static const std::string kConnectParamScheme("Scheme")
URL scheme.
std::string valueForKey(const std::string &inKey) const
static const std::string kConnectParamPort("Port")
Port number (optional)
A simple set of zero or more key/value pairs. (New in SDK 16.3)
std::map< std::string, std::string > Dict
Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions.
std::ostream & operator<<(std::ostream &oss, const NTV2Dictionary &inDict)