C# Класс PBCaGw.DataPacket

Handles messages between workers. Can contain either a TCP/UDP packet or an EPICS message
Наследование: ICloneable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Data byte[]
Destination System.Net.IPEndPoint
Kind DataPacketKind
ReverseAnswer bool
Sender System.Net.IPEndPoint

Открытые методы

Метод Описание
Clone ( ) : object

Clone this packet, creating an exact copy. As the clone function is an implementation of IClonable it must return an object.

Create ( DataPacket remaining, DataPacket newPacket ) : DataPacket

Merges 2 packets together

Create ( DataPacket packet, UInt32 size, bool reuse = false ) : DataPacket

Creates a new message based on an existing packed and use the "size" to extract only the first part.

Create ( byte buff ) : DataPacket
Create ( byte buff, int size, WorkerChain chain, bool reuseBuffer = false ) : DataPacket

Creates a new message based on the byte buffer however use only the first "size" byte for it.

Create ( int size ) : DataPacket
Create ( int payloadSize, WorkerChain chain ) : DataPacket

Creates a new message with the given payload size and sets the payload size correctly.

GetDataAsString ( ) : string

Retreives the payload as string.

GetUInt16 ( int position ) : UInt16

Returns an UInt16 at a given position

GetUInt32 ( int position ) : UInt32

Returns an UInt32 at a given position

Padding ( int size ) : int
SetBytes ( int position, byte buff ) : void
SetDataAsString ( string str ) : void
SetUInt16 ( int position, UInt16 value ) : void

Writes an UInt16 at a given position

SetUInt32 ( int position, UInt32 value ) : void

Writes an UInt32 at a given position

ShowPools ( ) : void
SkipSize ( UInt32 size, bool reuse = false ) : DataPacket

Skips a given size from the data block

Приватные методы

Метод Описание
DataPacket ( ) : System

Описание методов

Clone() публичный Метод

Clone this packet, creating an exact copy. As the clone function is an implementation of IClonable it must return an object.
public Clone ( ) : object
Результат object

Create() публичный статический Метод

Merges 2 packets together
public static Create ( DataPacket remaining, DataPacket newPacket ) : DataPacket
remaining DataPacket
newPacket DataPacket
Результат DataPacket

Create() публичный статический Метод

Creates a new message based on an existing packed and use the "size" to extract only the first part.
public static Create ( DataPacket packet, UInt32 size, bool reuse = false ) : DataPacket
packet DataPacket
size System.UInt32
reuse bool
Результат DataPacket

Create() публичный статический Метод

public static Create ( byte buff ) : DataPacket
buff byte
Результат DataPacket

Create() публичный статический Метод

Creates a new message based on the byte buffer however use only the first "size" byte for it.
public static Create ( byte buff, int size, WorkerChain chain, bool reuseBuffer = false ) : DataPacket
buff byte
size int
chain PBCaGw.Workers.WorkerChain
reuseBuffer bool
Результат DataPacket

Create() публичный статический Метод

public static Create ( int size ) : DataPacket
size int
Результат DataPacket

Create() публичный статический Метод

Creates a new message with the given payload size and sets the payload size correctly.
public static Create ( int payloadSize, WorkerChain chain ) : DataPacket
payloadSize int
chain PBCaGw.Workers.WorkerChain
Результат DataPacket

GetDataAsString() публичный Метод

Retreives the payload as string.
public GetDataAsString ( ) : string
Результат string

GetUInt16() публичный Метод

Returns an UInt16 at a given position
public GetUInt16 ( int position ) : UInt16
position int
Результат System.UInt16

GetUInt32() публичный Метод

Returns an UInt32 at a given position
public GetUInt32 ( int position ) : UInt32
position int
Результат System.UInt32

Padding() публичный статический Метод

public static Padding ( int size ) : int
size int
Результат int

SetBytes() публичный Метод

public SetBytes ( int position, byte buff ) : void
position int
buff byte
Результат void

SetDataAsString() публичный Метод

public SetDataAsString ( string str ) : void
str string
Результат void

SetUInt16() публичный Метод

Writes an UInt16 at a given position
public SetUInt16 ( int position, UInt16 value ) : void
position int
value System.UInt16
Результат void

SetUInt32() публичный Метод

Writes an UInt32 at a given position
public SetUInt32 ( int position, UInt32 value ) : void
position int
value System.UInt32
Результат void

ShowPools() публичный статический Метод

public static ShowPools ( ) : void
Результат void

SkipSize() публичный Метод

Skips a given size from the data block
public SkipSize ( UInt32 size, bool reuse = false ) : DataPacket
size System.UInt32
reuse bool
Результат DataPacket

Описание свойств

Data публичное свойство

public byte[] Data
Результат byte[]

Destination публичное свойство

public IPEndPoint,System.Net Destination
Результат System.Net.IPEndPoint

Kind публичное свойство

public DataPacketKind Kind
Результат DataPacketKind

ReverseAnswer публичное свойство

Allows to change the sending rules
public bool ReverseAnswer
Результат bool

Sender публичное свойство

public IPEndPoint,System.Net Sender
Результат System.Net.IPEndPoint