Entry.m 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. classdef(Abstract = true) Entry < handle
  2. %ENTRY base class for all Axion file entries
  3. %
  4. % EntryRecord: Record that indicated this recod in the file.
  5. %
  6. % Start: Location (# of bytes from start of file) of this
  7. % entryss
  8. properties (GetAccess = private, SetAccess = private)
  9. indiciesForChannels
  10. indiciesForElectrodes
  11. end
  12. properties (GetAccess = public, SetAccess = private)
  13. EntryRecord
  14. Start
  15. end
  16. methods (Access = protected)
  17. function this = Entry(varargin)
  18. % Entry: Construct a new instance of Entry.
  19. %s
  20. % Valid aruments:
  21. %
  22. % Entry() Consructs an entry that is not tied to a
  23. % location in a file.
  24. %
  25. % Entry(aEntryRecord, aStart) Constructs a new Entry where:
  26. %
  27. % aEntryRecord: An EntryRecord that specifies the type and
  28. % the length of the entry in the file
  29. %
  30. % aStart: An int64 specifiying the number of bytes
  31. % from the beginning of the file where the
  32. % entry starts in the file.
  33. %
  34. fNumArgs = length(varargin);
  35. if fNumArgs == 0
  36. % Handle the no-argument case
  37. return
  38. elseif fNumArgs == 2
  39. aEntryRecord = varargin{1};
  40. aStart = varargin{2};
  41. else
  42. error('Entry: Argument Error')
  43. end
  44. if(~isa(aEntryRecord, 'EntryRecord'))
  45. error('Entry: Unexpected Type')
  46. end
  47. if(~isa(aStart, 'int64'))
  48. error('Entry: Unexpected Type')
  49. end
  50. this.EntryRecord = aEntryRecord;
  51. this.Start = aStart;
  52. end
  53. end
  54. end