NDEVR
API Documentation
ModelSorter.h
1#pragma once
2#include <NDEVR/SoftwareService.h>
3#include <NDEVR/Buffer.h>
4#include <NDEVR/UUID.h>
5namespace NDEVR
6{
7 class DesignObject;
13 {
14 public:
20 virtual bool canSort(const DesignObject& a, const DesignObject& b) const = 0;
27 virtual bool isALessThanB(const DesignObject& a, const DesignObject& b) const = 0;
32 virtual UUID id() const = 0;
33 };
34
39 {
40 public:
45 static void AddSorter(ObjectSorter* sorter);
50 static Buffer<ObjectSorter*>& Sorters() { return s_sorters; };
55 static void RemoveSorter(UUID id);
56 private:
57 Buffer<ObjectSorter*> s_sorters;
58 };
59}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A low-level database object that can be used to access general stored properties within the NDEVR Mod...
Allows for sorting models when supported.
Definition ModelSorter.h:39
static void AddSorter(ObjectSorter *sorter)
Registers a new object sorter with the manager.
static Buffer< ObjectSorter * > & Sorters()
Returns the list of all registered object sorters.
Definition ModelSorter.h:50
static void RemoveSorter(UUID id)
Removes and unregisters the object sorter with the given ID.
Allows for sorting models when supported.
Definition ModelSorter.h:13
virtual bool isALessThanB(const DesignObject &a, const DesignObject &b) const =0
Returns true if a is evaluated to be less than b.
virtual bool canSort(const DesignObject &a, const DesignObject &b) const =0
Returns true if it is possible for this sorter to detemine the order of two objects.
virtual UUID id() const =0
A unique identifier for this sorting service.
Software Service Managers take a Software service to modify the behavior of the software.
Base interface for services that extend or modify software behavior through modules.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:61
The primary namespace for the NDEVR SDK.