Skip to content

Instantly share code, notes, and snippets.

@azinman
Created March 25, 2016 01:56
Show Gist options
  • Save azinman/8a636e2b2f29e294787b to your computer and use it in GitHub Desktop.
Save azinman/8a636e2b2f29e294787b to your computer and use it in GitHub Desktop.
autogenerated swift files from VDL
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This file was auto-generated by the vanadium vdl tool.
// Source: v.io/v23/naming
public enum Naming {
/* The following constants originate in file: types.vdl */
public static let Replace: NamingMountFlag = NamingMountFlag(rawValue: UInt32(1))
public static let MT: NamingMountFlag = NamingMountFlag(rawValue: UInt32(2))
public static let Leaf: NamingMountFlag = NamingMountFlag(rawValue: UInt32(4))
}
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This file was auto-generated by the vanadium vdl tool.
// Source: v.io/v23/naming/types.vdl
/// MountFlag is a bit mask of options to the mount call.
///
/// Auto-generated from v.io/v23/naming.MountFlag
public struct NamingMountFlag : VdlPrimitive , Hashable {
/// Vdl type for {@link NamingMountFlag}.
public static let vdlTypeName = "v.io/v23/naming.MountFlag"
// Conform to RawRepresentable for the underlying Type
public associatedtype RawValue = UInt32
public let rawValue: RawValue
/// Creates a new instance of {@link NamingMountFlag} with the given value.
public init(rawValue: UInt32) {
self.rawValue = rawValue
}
public var debugDescription: String {
return "NamingMountFlag(\(self.rawValue))"
}
public var hashValue: Int {
return self.rawValue.hashValue
}
}
public func ==(lhs: NamingMountFlag, rhs: NamingMountFlag) -> Bool {
return lhs.rawValue == rhs.rawValue
}
/// MountedServer represents a server mounted on a specific name.
///
/// Auto-generated from v.io/v23/naming.MountedServer
public class NamingMountedServer : VdlStruct, CustomDebugStringConvertible , Hashable {
/// Vdl type for {@link NamingMountedServer}.
public static let vdlTypeName = "v.io/v23/naming.MountedServer"
/// "Server" index 0
var server: String
/// "Deadline" index 1
var deadline: TimeWireDeadline
public init(
server: String,
deadline: TimeWireDeadline) {
self.server = server
self.deadline = deadline
}
public var hashValue: Int {
var result = 1
let prime = 31
result = prime * result + Int(self.server.hashValue)
result = prime * result + Int(self.deadline.hashValue)
return result
}
public var description: String {
return "v.io/v23/naming.MountedServer"
}
public var debugDescription: String {
var result = "[v.io/v23/naming.MountedServer "
result += "server:" + server.debugDescription
result += ", "
result += "deadline:" + deadline.debugDescription
return result + "]"
}
}
public func ==(lhs: NamingMountedServer, rhs: NamingMountedServer) -> Bool {
if lhs.server != rhs.server {
return false
}
if lhs.deadline != rhs.deadline {
return false
}
return true
}
/// MountEntry represents a given name mounted in the mounttable.
///
/// Auto-generated from v.io/v23/naming.MountEntry
public class NamingMountEntry : VdlStruct, CustomDebugStringConvertible {
/// Vdl type for {@link NamingMountEntry}.
public static let vdlTypeName = "v.io/v23/naming.MountEntry"
/// "Name" index 0
var name: String
/// "Servers" index 1
var servers: [NamingMountedServer]
/// "ServesMountTable" index 2
var servesMountTable: Bool
/// "IsLeaf" index 3
var isLeaf: Bool
public init(
name: String,
servers: [NamingMountedServer],
servesMountTable: Bool,
isLeaf: Bool) {
self.name = name
self.servers = servers
self.servesMountTable = servesMountTable
self.isLeaf = isLeaf
}
public var description: String {
return "v.io/v23/naming.MountEntry"
}
public var debugDescription: String {
var result = "[v.io/v23/naming.MountEntry "
result += "name:" + name.debugDescription
result += ", "
result += "servers:" + servers.debugDescription
result += ", "
result += "servesMountTable:" + servesMountTable.debugDescription
result += ", "
result += "isLeaf:" + isLeaf.debugDescription
return result + "]"
}
}
/// GlobError is returned by namespace.Glob to indicate a subtree of the namespace
/// that could not be traversed.
///
/// Auto-generated from v.io/v23/naming.GlobError
public class NamingGlobError : VdlStruct, CustomDebugStringConvertible {
/// Vdl type for {@link NamingGlobError}.
public static let vdlTypeName = "v.io/v23/naming.GlobError"
/// "Name" index 0
var name: String
/// "Error" index 1
var error: VError?
public init(
name: String,
error: VError?) {
self.name = name
self.error = error
}
public var description: String {
return "v.io/v23/naming.GlobError"
}
public var debugDescription: String {
var result = "[v.io/v23/naming.GlobError "
result += "name:" + name.debugDescription
result += ", "
result += "error:" + error.debugDescription
return result + "]"
}
}
/// GlobReply is the data type returned by Glob__.
///
/// Auto-generated from v.io/v23/naming.GlobReply
public enum NamingGlobReply : VdlUnion {
/// Vdl type for {@link NamingGlobReply}.
public static let vdlTypeName = "v.io/v23/naming.GlobReply"
/// GeneratedFromVdl(name = "Entry", index = 0)
case Entry(elem:NamingMountEntry)
/// GeneratedFromVdl(name = "Error", index = 1)
case Error(elem:NamingGlobError)
public var vdlName: String {
switch self {
case .Entry: return "Entry"
case .Error: return "Error"
}
}
public var description: String {
return vdlName
}
public var debugDescription: String {
switch self {
case let .Entry(elem): return "Entry(\(elem.debugDescription))"
case let .Error(elem): return "Error(\(elem.debugDescription))"
}
}
}
/// GlobChildrenReply is the data type returned by GlobChildren__.
///
/// Auto-generated from v.io/v23/naming.GlobChildrenReply
public enum NamingGlobChildrenReply : VdlUnion {
/// Vdl type for {@link NamingGlobChildrenReply}.
public static let vdlTypeName = "v.io/v23/naming.GlobChildrenReply"
/// GeneratedFromVdl(name = "Name", index = 0)
case Name(elem:String)
/// GeneratedFromVdl(name = "Error", index = 1)
case Error(elem:NamingGlobError)
public var vdlName: String {
switch self {
case .Name: return "Name"
case .Error: return "Error"
}
}
public var description: String {
return vdlName
}
public var debugDescription: String {
switch self {
case let .Name(elem): return "Name(\(elem.debugDescription))"
case let .Error(elem): return "Error(\(elem.debugDescription))"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment