HARDT - The Ham Radio DSP Toolkit
Public Member Functions | List of all members
HNetworkProcessor< T > Class Template Reference

#include <hnetworkprocessor.h>

Inheritance diagram for HNetworkProcessor< T >:
Inheritance graph
[legend]
Collaboration diagram for HNetworkProcessor< T >:
Collaboration graph
[legend]

Public Member Functions

 HNetworkProcessor (const char *address, int dataPort, int commandPort, HWriter< T > *writer, int blocksize, bool *terminationToken)
 
 HNetworkProcessor (const char *address, int dataPort, int commandPort, int blocksize, bool *terminationToken)
 
 HNetworkProcessor (const char *address, int dataPort, int commandPort, HReader< T > *reader, int blocksize, bool *terminationToken)
 
 HNetworkProcessor (int dataPort, int commandPort, HWriter< T > *writer, int blocksize, bool *terminationToken)
 
 HNetworkProcessor (int dataPort, int commandPort, int blocksize, bool *terminationToken)
 
 HNetworkProcessor (int dataPort, int commandPort, HReader< T > *reader, int blocksize, bool *terminationToken)
 
 ~HNetworkProcessor ()
 
void Run (long unsigned int blocks=0)
 
void Halt ()
 
bool Command (H_COMMAND_CLASS commandClass, H_COMMAND_OPCODE commandOpcode, int16_t length, HCommandData data)
 
- Public Member Functions inherited from HProcessor< T >
int Read (T *dest, int blocksize)
 
int Write (T *src, int blocksize)
 
HReader< T > * GetReader ()
 
HWriter< T > * GetWriter ()
 
bool Command (H_COMMAND_CLASS commandClass, H_COMMAND_OPCODE commandOpcode, int32_t value)
 
bool Command (H_COMMAND_CLASS commandClass, H_COMMAND_OPCODE commandOpcode, int16_t length, void *content)
 
bool Command (H_COMMAND_CLASS commandClass, H_COMMAND_OPCODE commandOpcode, bool state)
 
HMetricsGetMetrics ()
 
- Public Member Functions inherited from HWriterConsumer< T >
HWriterConsumer< T > * Consumer ()
 
- Public Member Functions inherited from HObject
 HObject ()
 

Additional Inherited Members

- Protected Member Functions inherited from HProcessor< T >
 HProcessor (HWriter< T > *writer, HReader< T > *reader, size_t blocksize, bool *terminationToken)
 
 HProcessor (HReader< T > *reader, size_t blocksize, bool *terminationToken)
 
 ~HProcessor ()
 
void SetWriter (HWriter< T > *writer)
 
- Protected Attributes inherited from HProcessor< T >
HWriter< T > * _writer
 
HReader< T > * _reader
 

Detailed Description

template<class T>
class HNetworkProcessor< T >

A network enabled processor.

The processor will either read from a network connection and write to a local writer, or read from a local reader and write to the a network connection.

If you use the constructors without the 'address' variable, the processor acts like the server and awaits connections, while using the constructor with the address, the processor will attempt to connect to that address and either read from it or write to it.

Examples
network.cpp.

Constructor & Destructor Documentation

◆ HNetworkProcessor() [1/6]

template<class T >
HNetworkProcessor< T >::HNetworkProcessor ( const char *  address,
int  dataPort,
int  commandPort,
HWriter< T > *  writer,
int  blocksize,
bool *  terminationToken 
)

Construct a new HNetworkProcessor that acts as a client, reading samples from the remote endpoint and writing them to a local writer.

◆ HNetworkProcessor() [2/6]

template<class T >
HNetworkProcessor< T >::HNetworkProcessor ( const char *  address,
int  dataPort,
int  commandPort,
int  blocksize,
bool *  terminationToken 
)

Construct a new HNetworkProcessor that acts as a client, reading samples from the remote endpoint and writing them to a local writer which must register by using the HWriterConsumer interface.

◆ HNetworkProcessor() [3/6]

template<class T >
HNetworkProcessor< T >::HNetworkProcessor ( const char *  address,
int  dataPort,
int  commandPort,
HReader< T > *  reader,
int  blocksize,
bool *  terminationToken 
)

Construct a new HNetworkProcessor that acts as a client, reading samples from a local reader and writing them to the remote endpoint

◆ HNetworkProcessor() [4/6]

template<class T >
HNetworkProcessor< T >::HNetworkProcessor ( int  dataPort,
int  commandPort,
HWriter< T > *  writer,
int  blocksize,
bool *  terminationToken 
)

Construct a new HNetworkProcessor that acts as a server, reading samples from the remote endpoint and writing them to a local writer.

◆ HNetworkProcessor() [5/6]

template<class T >
HNetworkProcessor< T >::HNetworkProcessor ( int  dataPort,
int  commandPort,
int  blocksize,
bool *  terminationToken 
)

Construct a new HNetworkProcessor that acts as a server, reading samples from the remote endpoint and writing them to a local writer which must register by using the HWriterConsumer interface.

◆ HNetworkProcessor() [6/6]

template<class T >
HNetworkProcessor< T >::HNetworkProcessor ( int  dataPort,
int  commandPort,
HReader< T > *  reader,
int  blocksize,
bool *  terminationToken 
)

Construct a new HNetworkProcessor that acts as a server, reading samples from a local reader and writing them to the remote endpoint.

◆ ~HNetworkProcessor()

template<class T >
HNetworkProcessor< T >::~HNetworkProcessor

Default destructor

Member Function Documentation

◆ Command()

template<class T >
bool HNetworkProcessor< T >::Command ( H_COMMAND_CLASS  commandClass,
H_COMMAND_OPCODE  commandOpcode,
int16_t  length,
HCommandData  data 
)
inlinevirtual

Send a command

Implements HProcessor< T >.

◆ Halt()

template<class T >
void HNetworkProcessor< T >::Halt
virtual

Halt the processor. This will set the associated terminationToken to true

Reimplemented from HProcessor< T >.

◆ Run()

template<class T >
void HNetworkProcessor< T >::Run ( long unsigned int  blocks = 0)
virtual

Run the processor

Reimplemented from HProcessor< T >.


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