Deskflow 1.27.0.8
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
deskflow::server::Config Class Reference

Server configuration. More...

#include <Config.h>

Classes

class  CellEdge
class  const_iterator

Public Types

using ScreenOptions = std::map<OptionID, OptionValue>
using Interval = std::pair<float, float>
using link_const_iterator = Cell::const_iterator
using internal_const_iterator = CellMap::const_iterator
using all_const_iterator = NameMap::const_iterator

Public Member Functions

 Config (IEventQueue *events)
virtual ~Config ()=default
manipulators
bool addComputer (const std::string &name)
 Add computer.
bool addAlias (const std::string &canonical, const std::string &alias)
 Add alias.
bool connect (const std::string &srcName, Direction srcSide, float srcStart, float srcEnd, const std::string &dstName, float dstStart, float dstEnd)
 Connect computers.
bool disconnect (const std::string &srcName, Direction srcSide)
 Disconnect computers.
bool disconnect (const std::string &srcName, Direction srcSide, float position)
 Disconnect computers.
void setDeskflowAddress (const NetworkAddress &)
 Set server address.
bool addOption (const std::string &name, OptionID option, OptionValue value)
 Add a computer option.
virtual InputFilter * getInputFilter ()
 Get the hot key input filter.

accessors

bool isValidComputerName (const std::string &name) const
 Test computer name validity.
const_iterator begin () const
 Get beginning (canonical) computer name iterator.
const_iterator end () const
 Get ending (canonical) computer name iterator.
all_const_iterator beginAll () const
 Get beginning computer name iterator.
all_const_iterator endAll () const
 Get ending computer name iterator.
virtual bool isComputer (const std::string &name) const
 Test for computer name.
bool isCanonicalName (const std::string &name) const
 Test for canonical computer name.
std::string getCanonicalName (const std::string &name) const
 Get canonical name.
std::string getNeighbor (const std::string &, Direction, float position, float *positionOut) const
 Get neighbor.
bool hasNeighbor (const std::string &, Direction) const
 Check for neighbor.
bool hasNeighbor (const std::string &, Direction, float start, float end) const
 Check for neighbor.
link_const_iterator beginNeighbor (const std::string &) const
 Get beginning neighbor iterator.
link_const_iterator endNeighbor (const std::string &) const
 Get ending neighbor iterator.
const NetworkAddress & getDeskflowAddress () const
 Get the server address.
const ScreenOptions * getOptions (const std::string &name) const
 Get the computer options.
bool hasLockToComputerAction () const
 Check for lock to computer action.
bool operator== (const Config &) const
 Compare configurations.
void read (ConfigReadContext &context)
 Read configuration.
std::istream & operator>> (std::istream &s, Config &config)
 Read configuration.
std::ostream & operator<< (std::ostream &s, const Config &config)
 Write configuration.
static const char * dirName (Direction)
 Get direction name.
static std::string formatInterval (const Interval &)
 Get interval as string.

Detailed Description

Server configuration.

This class holds server configuration information. That includes the names of computers and their aliases, the links between them, and network addresses.

Note that case is preserved in computer names but is ignored when comparing names. computer names and their aliases share a namespace and must be unique.

Member Typedef Documentation

◆ all_const_iterator

using deskflow::server::Config::all_const_iterator = NameMap::const_iterator

◆ internal_const_iterator

using deskflow::server::Config::internal_const_iterator = CellMap::const_iterator

◆ Interval

using deskflow::server::Config::Interval = std::pair<float, float>

◆ link_const_iterator

using deskflow::server::Config::link_const_iterator = Cell::const_iterator

◆ ScreenOptions

Constructor & Destructor Documentation

◆ Config()

deskflow::server::Config::Config ( IEventQueue * events)
explicit

◆ ~Config()

virtual deskflow::server::Config::~Config ( )
virtualdefault

Member Function Documentation

◆ addAlias()

bool deskflow::server::Config::addAlias ( const std::string & canonical,
const std::string & alias )

Add alias.

Adds an alias for a computer name. An alias can be used any place the canonical computer name can (except addComputer()). Returns false if the alias name already exists or the canonical name is unknown, otherwise returns true.

◆ addComputer()

bool deskflow::server::Config::addComputer ( const std::string & name)

Add computer.

Adds a computer, returning true if successful. If a computer or alias with the given name exists then it fails.

◆ addOption()

bool deskflow::server::Config::addOption ( const std::string & name,
OptionID option,
OptionValue value )

Add a computer option.

Adds an option and its value to the named computer. Replaces the existing option's value if there is one. Returns true iff name is a known computer.

◆ begin()

Config::const_iterator deskflow::server::Config::begin ( ) const

Get beginning (canonical) computer name iterator.

◆ beginAll()

Config::all_const_iterator deskflow::server::Config::beginAll ( ) const

Get beginning computer name iterator.

◆ beginNeighbor()

Config::link_const_iterator deskflow::server::Config::beginNeighbor ( const std::string & srcName) const

Get beginning neighbor iterator.

◆ connect()

bool deskflow::server::Config::connect ( const std::string & srcName,
Direction srcSide,
float srcStart,
float srcEnd,
const std::string & dstName,
float dstStart,
float dstEnd )

Connect computers.

Establishes a one-way connection between portions of opposite edges of two computers. Each portion is described by an interval defined by two numbers, the start and end of the interval half-open on the end. The numbers range from 0 to 1, inclusive, for the left/top to the right/bottom. The user will be able to jump from the srcStart to srcSend interval of srcSide of computer srcName to the opposite side of computer dstName in the interval dstStart and dstEnd when both computers are connected to the server and the user isn't locked to a computer. Returns false if srcName is unknown. srcStart must be less than or equal to srcEnd and dstStart must be less then or equal to dstEnd and all of srcStart, srcEnd, dstStart, or dstEnd must be inside the range [0,1].

◆ dirName()

const char * deskflow::server::Config::dirName ( Direction dir)
static

Get direction name.

Returns the name of a direction (for debugging).

◆ disconnect() [1/2]

bool deskflow::server::Config::disconnect ( const std::string & srcName,
Direction srcSide )

Disconnect computers.

Removes all connections created by connect() on side srcSide. Returns false if srcName is unknown.

◆ disconnect() [2/2]

bool deskflow::server::Config::disconnect ( const std::string & srcName,
Direction srcSide,
float position )

Disconnect computers.

Removes the connections created by connect() on side srcSide covering position position. Returns false if srcName is unknown.

◆ end()

Config::const_iterator deskflow::server::Config::end ( ) const

Get ending (canonical) computer name iterator.

◆ endAll()

Config::all_const_iterator deskflow::server::Config::endAll ( ) const

Get ending computer name iterator.

◆ endNeighbor()

Config::link_const_iterator deskflow::server::Config::endNeighbor ( const std::string & srcName) const

Get ending neighbor iterator.

◆ formatInterval()

std::string deskflow::server::Config::formatInterval ( const Interval & x)
static

Get interval as string.

Returns an interval as a parseable string.

◆ getCanonicalName()

std::string deskflow::server::Config::getCanonicalName ( const std::string & name) const

Get canonical name.

Returns the canonical name of a computer or the empty string if the name is unknown. Returns the canonical name if one is given.

◆ getDeskflowAddress()

const NetworkAddress & deskflow::server::Config::getDeskflowAddress ( ) const

Get the server address.

◆ getInputFilter()

InputFilter * deskflow::server::Config::getInputFilter ( )
virtual

Get the hot key input filter.

Returns the hot key input filter. Clients can modify hotkeys using that object.

◆ getNeighbor()

std::string deskflow::server::Config::getNeighbor ( const std::string & srcName,
Direction srcSide,
float position,
float * positionOut ) const

Get neighbor.

Returns the canonical computer name of the neighbor in the given direction (set through connect()) at position position. Returns the empty string if there is no neighbor in that direction, otherwise saves the position on the neighbor in positionOut if it's not nullptr.

◆ getOptions()

const Config::ScreenOptions * deskflow::server::Config::getOptions ( const std::string & name) const

Get the computer options.

Returns all the added options for the named computer. Returns nullptr if the computer is unknown and an empty collection if there are no options.

◆ hasLockToComputerAction()

bool deskflow::server::Config::hasLockToComputerAction ( ) const

Check for lock to computer action.

Returns true if this configuration has a lock to computer action. This is for backwards compatible support of ScrollLock locking.

◆ hasNeighbor() [1/2]

bool deskflow::server::Config::hasNeighbor ( const std::string & srcName,
Direction srcSide ) const

Check for neighbor.

Returns true if the computer has a neighbor anywhere along the edge given by the direction.

◆ hasNeighbor() [2/2]

bool deskflow::server::Config::hasNeighbor ( const std::string & srcName,
Direction srcSide,
float start,
float end ) const

Check for neighbor.

Returns true if the computer has a neighbor in the given range along the edge given by the direction.

◆ isCanonicalName()

bool deskflow::server::Config::isCanonicalName ( const std::string & name) const

Test for canonical computer name.

Returns true iff name is the canonical name of a computer.

◆ isComputer()

bool deskflow::server::Config::isComputer ( const std::string & name) const
virtual

Test for computer name.

Returns true iff name names a computer.

◆ isValidComputerName()

bool deskflow::server::Config::isValidComputerName ( const std::string & name) const

Test computer name validity.

Returns true iff name is a valid computer name.

◆ operator==()

bool deskflow::server::Config::operator== ( const Config & x) const

Compare configurations.

◆ read()

void deskflow::server::Config::read ( ConfigReadContext & context)

Read configuration.

Reads a configuration from a context. Throws ServerConfigReadException on error and context is unchanged.

◆ setDeskflowAddress()

void deskflow::server::Config::setDeskflowAddress ( const NetworkAddress & addr)

Set server address.

Set the deskflow listen addresses. There is no default address so this must be called to run a server using this configuration.

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const Config & config )
friend

Write configuration.

Writes a configuration to a stream.

◆ operator>>

std::istream & operator>> ( std::istream & s,
Config & config )
friend

Read configuration.

Reads a configuration from a stream. Throws ServerConfigReadException on error.


The documentation for this class was generated from the following files: