1 // Written in the D programming language.
2 
3 /**
4 A type for representing the afid object of the 9P / Styx protocol. 
5 
6 Copyright: LightHouse Software, 2021
7 License:   $(HTTP https://github.com/aquaratixc/ESL-License, Experimental Software License 1.0).
8 Authors:   Oleg Bakharev,
9 		   Ilya Pertsev
10 */
11 module styx2000.protobj.afid;
12 
13 private {
14 	import std..string : format;
15 
16 	import styx2000.protobj.styxobject;
17 	
18 	import styx2000.protoconst.base : STYX_NOFID;
19 	
20 	import styx2000.protobj.fid;
21 }
22 
23 /**
24 	A class that provides a type for the afid field in some Styx messages. Inherits methods from the Fid class and the StyxObject class. 
25 	See_Also:
26 		https://web.archive.org/web/20201029184954/https://powerman.name/Inferno/man/5/0intro.html
27 */
28 class Afid : Fid
29 {
30 	/**
31 	A constructor that creates an object of the Afid class with the given parameter in the form of some integer value representing fid. 
32 	If called without parameters, then the default parameter is the STYX_NOFID value from styx2000.protoconst.base. 
33     Params:
34     fid = Unique 32-bit value assigned by the Styx client.
35     
36     Typical usage:
37     ----
38     Afid afid = new Afid(0);
39     ----
40     */
41 	this(uint fid = STYX_NOFID)
42 	{
43 		super(fid);
44 	}
45 	
46 	/// An alias that allows you to call a getter method without accessing the base Fid class
47 	alias getAfid = getFid;	
48 	/// An alias that allows you to call a setter method without accessing the base Fid class
49 	alias setAfid = setFid;	
50 	
51 	/// Convenient string representation of an object for printing 
52 	override string toString()
53 	{
54 		return format(
55 			`Afid(afid=%d)`,
56 			_fid
57 		);
58 	}
59 	
60 	/// An alias for easier packing into a byte array without having to manually call the pack() method
61 	alias pack this;
62 }