diff options
Diffstat (limited to 'libkms++')
-rw-r--r-- | libkms++/card.cpp | 35 | ||||
-rw-r--r-- | libkms++/card.h | 11 |
2 files changed, 8 insertions, 38 deletions
diff --git a/libkms++/card.cpp b/libkms++/card.cpp index 3aaa8a6..038d494 100644 --- a/libkms++/card.cpp +++ b/libkms++/card.cpp @@ -182,40 +182,7 @@ DrmObject* Card::get_object(uint32_t id) const return m_obmap.at(id); } -vector<Connector*> Card::get_connectors() const -{ - vector<Connector*> v; - for(auto pair : m_obmap) { - auto p = dynamic_cast<Connector*>(pair.second); - if (p) - v.push_back(p); - } - return v; -} - -vector<Crtc*> Card::get_crtcs() const -{ - vector<Crtc*> v; - for(auto pair : m_obmap) { - auto p = dynamic_cast<Crtc*>(pair.second); - if (p) - v.push_back(p); - } - return v; -} - -vector<Plane*> Card::get_planes() const -{ - vector<Plane*> v; - for(auto pair : m_obmap) { - auto p = dynamic_cast<Plane*>(pair.second); - if (p) - v.push_back(p); - } - return v; -} - -vector<DrmObject*> Card::get_objects() const +const vector<DrmObject*> Card::get_objects() const { vector<DrmObject*> v; for(auto pair : m_obmap) diff --git a/libkms++/card.h b/libkms++/card.h index 25261be..cfc1cf2 100644 --- a/libkms++/card.h +++ b/libkms++/card.h @@ -37,10 +37,13 @@ public: void print_short() const; - std::vector<Connector*> get_connectors() const; - std::vector<Crtc*> get_crtcs() const; - std::vector<DrmObject*> get_objects() const; - std::vector<Plane*> get_planes() const; + const std::vector<Connector*> get_connectors() const { return m_connectors; } + const std::vector<Encoder*> get_encoders() const { return m_encoders; } + const std::vector<Crtc*> get_crtcs() const { return m_crtcs; } + const std::vector<Plane*> get_planes() const { return m_planes; } + const std::vector<Property*> get_properties() const { return m_properties; } + + const std::vector<DrmObject*> get_objects() const; std::vector<Pipeline> get_connected_pipelines(); |