30 #include <unordered_map>
42 class SaleaeDirectory;
44 #ifndef STANDALONE_PARSER
82 uint64_t mNumberValues;
86 : mIndex(inx), mBeginTime(tBeg), mEndTime(tEnd), mNumberValues(nval) {;}
89 int index()
const {
return mIndex; }
95 uint64_t
endTime()
const {
return mEndTime; }
163 std::vector<int> mChildKeys;
164 std::vector<int> mData;
182 const std::vector<int>&
get_data()
const {
return mData; }
185 void set_data(
const std::vector<int>& dat);
222 std::string mDirectoryFile;
223 std::vector<SaleaeDirectoryNetEntry> mNetEntries;
224 std::unordered_map<int,SaleaeDirectoryComposedEntry> mComposedEntryMap;
226 std::unordered_map<uint32_t,int> mById;
227 std::unordered_map<std::string, int> mByName;
230 int mNextAvailableIndex;
232 #ifndef STANDALONE_PARSER
233 bool write_json()
const;
249 std::vector<SaleaeDirectoryNetEntry>
dump()
const;
255 void rename_net(uint32_t
id,
const std::string& nam);
The SaleaeDirectoryComposedEntry class represents a composed waveform. There are currently three type...
void add_child(int key)
Add an additional child key to composed.
SaleaeDirectoryComposedEntry(const std::string nam=std::string(), uint32_t id_=0, Type tp=None)
void dump() const
Dump to stdout.
~SaleaeDirectoryComposedEntry()
void set_data(const std::vector< int > &dat)
Setter for data list described above.
const std::vector< int > & get_data() const
Getter for data list which is used a) Boolean: list of accepted(=true) net combinations b) Trigger: t...
int get_filter_entry() const
Only used for trigger: Pointer to filter (suppress trigger unless value 1), null if no filter used.
void set_filter_entry(int filt)
Setter for filter pointer described above.
bool isNull() const
Test for null.
void remove_child(int key)
Remove child key from composed.
const std::vector< int > & get_children() const
Access to child keys.
The SaleaeDirectoryFileIndex class represents a single SALEAE data file. The class comprises the inde...
uint64_t beginTime() const
Getter for first time value in SALEAE file.
SaleaeDirectoryFileIndex(int inx, uint64_t tBeg=0, uint64_t tEnd=0, uint64_t nval=0)
Constructor.
int index() const
Getter for SALEAE data file index.
uint64_t endTime() const
Getter for last time value in SALEAE file.
uint64_t numberValues() const
Getter for number of transitions + 1 (start value)
The SaleaeDirectory class provides the API for the SALEAE directory file. The SALEAE directory file w...
void rename_net(uint32_t id, const std::string &nam)
Change waveform name entry for net identified by id.
int get_datafile_index(const std::string &nam, uint32_t id) const
Get waveform datafile index for net identified by name and id.
void clearAll()
Remove all files and reset internal variables.
void add_or_replace_net(SaleaeDirectoryNetEntry &sdne)
Add net entry if not yet existing, replace existing entry otherwise.
bool parse_json()
Parse .json file into class instance.
std::string get_directory() const
Get path to SALEAE directory without filename.
std::vector< SaleaeDirectoryNetEntry > dump() const
Dump content of class instance to console for debugging purpose.
std::string get_datafile_name(int index) const
Get waveform datafile name without path (digital_XXX.bin)
SaleaeDirectory(const std::string &path, bool create=false)
constructor
std::vector< SaleaeDirectoryComposedEntry > get_composed_list() const
Getter to list of all composed waveform entries.
void add_or_replace_composed(SaleaeDirectoryComposedEntry sdce)
Add composed waveform entry (Group, Boolean, Trigger)
int get_next_available_index() const
Getter for next available file index ('digital_XXX.bin' with lowest number XXX not in use)
void remove_composed(uint32_t id, SaleaeDirectoryNetEntry::Type tp)
Remove composed waveform entry identified by id an type.
void update_file_indexes(std::unordered_map< int, SaleaeDirectoryFileIndex > &fileIndexes)
Update file index information (like number of transitions, end time ...) after writing SALEAE files.
SaleaeDirectoryComposedEntry get_composed(uint32_t id, SaleaeDirectoryNetEntry::Type tp) const
Getter for pointer to composed waveform entry allowing modifications.
std::vector< ListEntry > get_net_list() const
Getter for all net entries.
std::string get_datafile_path(int index) const
Get full path to waveform data file.
std::string get_filename() const
Get full path to saleae directory file including filename (/.../saleae.json)
uint64_t get_max_time() const
Getter for maximum time.
The SaleaeDirectoryNetEntry class represents a regular waveform for a single simulated net....
int dataFileIndex() const
Return last data file index (currently there should be no more than one)
void rename(const std::string nam)
Rename waveform.
int uniqueKey() const
Unique key as reference (used e.g. in mComposedEntryMap)
uint32_t id() const
Getter for waveform ID = simulated net ID.
virtual ~SaleaeDirectoryNetEntry()
const std::vector< SaleaeDirectoryFileIndex > & indexes() const
Getter for list of associated binary files indexes.
std::vector< SaleaeDirectoryFileIndex > mFileIndexes
SaleaeDirectoryNetEntry(const std::string nam, uint32_t id_=0, Type tp=None)
Constructor.
Type type() const
Getter for composed type, None for regular waveform.
static const int sComposedBaseKey
void addIndex(const SaleaeDirectoryFileIndex &sdfe)
Add index for binary file to net entry instance.
std::string name() const
Getter for waveform name.
The SaleaeDirectoryStoreRequest class is useful to bundle requests for updating SALEAE directory....
static bool sWriteDisabled
~SaleaeDirectoryStoreRequest()
const char folderSeparator