RVS_BTDriver_OBD_DTC_Container
public protocol RVS_BTDriver_OBD_DTC_Container : Sequence where Self.Element == String
This is the base protocol for command interpreters. It defines an Array of String, which is used to match the interpreter with the PID it is applied to.
The sequence conformance allows us to act as a sequence of String
-
These are the DTC codes returned by the device.
Declaration
Swift
var codes: [RVS_BTDriver_OBD_DTC] { get }
-
codesAsStrings
Default implementationThese are the DTC codes returned by the device, but as an Array of String.
Default Implementation
The default implementation is pretty much all we need.
Declaration
Swift
var codesAsStrings: [String] { get }
-
subscript(_:)
Default implementationWe have a simple subscript, allowing us to get the codes as if we are an Array.
Default Implementation
Declaration
Swift
subscript(index: Int) -> String { get }
Parameters
index
The 0-based index of the item we want.
-
count
Default implementationThe count is simply how many codes we have.
Default Implementation
Default should be all we need to get this.
Declaration
Swift
var count: Int { get }
-
makeIterator()
Extension methodThe iterator is quite simple. We just return an Array of String’s iterator.
Declaration
Swift
public func makeIterator() -> Array<String>.Iterator