GM6000 Digital Heater Controller Build: 16 (Branch = develop)
SDX-1330
Random.h
Go to the documentation of this file.
1#ifndef Driver_Crypt_TShell_Random_h
2#define Driver_Crypt_TShell_Random_h
3/*-----------------------------------------------------------------------------
4* This file is part of the Colony.Core Project. The Colony.Core Project is an
5* open source project with a BSD type of licensing agreement. See the license
6* agreement (license.txt) in the top/ directory or on the Internet at
7* http://integerfox.com/colony.core/license.txt
8*
9* Copyright (c) 2014-2025 John T. Taylor
10* Copyright (c) 2014-2025 John T. Taylor
11*
12* Redistributions of the source code must retain the above copyright notice.
13*----------------------------------------------------------------------------*/
14/** @file */
15
16#include "colony_config.h"
18
19
20///
21namespace Driver {
22///
23namespace Crypto {
24///
25namespace TShell {
26
27/** This class implements a Shell command. This command is only 'useful' if
28 the application was built to use simulated time (see Cpl::System::SimTick.h).
29 */
31{
32public:
33 /// The command verb/identifier
34 static constexpr const char* verb = "rnd";
35
36 /// The command usage string
37 static constexpr const char* usage = "rnd <numBytes>";
38
39 /** The command detailed help string (recommended that lines do not exceed 80 chars)
40 1 2 3 4 5 6 7 8
41 12345678901234567890123456789012345678901234567890123456789012345678901234567890
42 */
43 static constexpr const char* detailedHelp = " Generates a random number of <numBytes> long.";
44
45
46protected:
47 /// See Cpl::TShell::Command
48 const char* getUsage() const noexcept { return usage; }
49
50 /// See Cpl::TShell::Command
51 const char* getHelp() const noexcept { return detailedHelp; }
52
53
54public:
55 /// Constructor
58
59public:
60 /// See Cpl::TShell::Command
61 Cpl::TShell::Command::Result_T execute( Cpl::TShell::Context_& context, char* cmdString, Cpl::Io::Output& outfd ) noexcept;
62};
63
64} // end namespaces
65}
66}
67#endif // end header latch
#define OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL
Default Permission level for all commands.
Definition Command.h:22
This template class implements a THREAD SAFE Ring Buffer.
Definition RingBufferMT.h:33
This partially abstract class defines a interface for operating on an output stream (example of a str...
Definition Output.h:34
This partially concrete class implements infrastructure and/or common functionality for a Shell comma...
Definition Command.h:37
Result_T
Possible result codes when executing a command.
Definition Command.h:35
This Private Namespace class defines a "Context" for a TShell command.
Definition Context_.h:32
Permission_T
Permissions levels.
Definition Security.h:34
This class implements a Shell command.
Definition Random.h:31
const char * getHelp() const noexcept
See Cpl::TShell::Command.
Definition Random.h:51
const char * getUsage() const noexcept
See Cpl::TShell::Command.
Definition Random.h:48
static constexpr const char * usage
The command usage string.
Definition Random.h:37
static constexpr const char * verb
The command verb/identifier.
Definition Random.h:34
static constexpr const char * detailedHelp
The command detailed help string (recommended that lines do not exceed 80 chars) 1 2 3 4 5 6 7 8 1234...
Definition Random.h:43
Cpl::TShell::Command::Result_T execute(Cpl::TShell::Context_ &context, char *cmdString, Cpl::Io::Output &outfd) noexcept
See Cpl::TShell::Command.
Random(Cpl::Container::SList< Cpl::TShell::Command > &commandList, Cpl::TShell::Security::Permission_T minPermLevel=OPTION_TSHELL_CMD_COMMAND_DEFAULT_PERMISSION_LEVEL) noexcept
Constructor.
namespace