Working on 'efficient slice' and also PSI stuff

This commit is contained in:
Saxon Milton 2018-01-11 22:36:57 +10:30
parent 644ef7aea8
commit a87f59db34
4 changed files with 56 additions and 17 deletions

View File

@ -1,15 +0,0 @@
package efficientbuffer
type EfficientBuffer struct {
}
// TODO: work out how I can combine the following two functions into one
// using interfaces - we check what type it is and deal with accordingly
func Append(b1 *EfficientBuffer, b2 *EfficientBuffer)(out *EfficientBuffer){
}
func Append(b1 *EfficientBuffer, b2 []byte)(out *EfficientBuffer){
}

28
effslice/EffSlice.go Normal file
View File

@ -0,0 +1,28 @@
package efficientbuffer
type dataBlock struct {
address []byte // Address of the data block (slice)
lowerBound int // Lower bound of the data we're interested in
upperBound int // Upper bound of the data we're interested in
startIndex int // Index in our EffSlice
}
type EffSlice struct {
data map[int](*dataChunk)
}
func (s *EffSlice)GetElement(index int) byte {
}
func (s *EffSlice)AsByteSlice() []byte {
}
func (s *EffSlice)Append(data *EffSlice){
}
func (s *EffSlice)Append(data []byte){
}
func (s *EffSlice)Len(){
}

View File

@ -28,7 +28,22 @@ LICENSE
package psi
type PAT struct {
PF byte // POint field
PFB []byte // pointer filler bytes
TableID byte // Table ID
SSI bool // Sectiopn syntax indicator (1 for PAT, PMT, CAT)
PB bool // Private bit (0 for PAT, PMT, CAT)
SL uint16 // Section length
TIE uint16 // Table ID extension
Version byte // Version number
CNI bool // Current/next indicator
Section byte // Section number
LSN byte // Last section number
DT byte // Descriptor tag
DL byte // Descriptor length
Program uint16 // Program number
PMPID uint16 // Program map PID
CRC32 uint32 // Checksum of table
}
type (p *PAT)ToByteSlice()(output []byte){

View File

@ -28,7 +28,18 @@ LICENSE
package psi
type PMT struct {
PF byte // POint field
PFB []byte // pointer filler bytes
TableID byte // Table ID
SSI bool // Sectiopn syntax indicator (1 for PAT, PMT, CAT)
PB bool // Private bit (0 for PAT, PMT, CAT)
SL uint16 // Section length
TIE uint16 // Table ID extension
Version byte // Version number
CNI bool // Current/next indicator
Section byte // Section number
LSN byte // Last section number
}
func (p* PMT)ToByteSlice()(output []byte){