Files
sunnypilot/third_party/snpe/include/DlSystem/String.hpp
Jason Wen acd46aa94b modeld: retain SNPE and thneed drive model support (#555)
* modeld: Retain pre-20hz drive model support

* Method not available anymore on OP

* some fixes

* Revert "Long planner get accel: new function args (#34288)"

* Revert "Fix low-speed allow_throttle behavior in long planner (#33894)"

* Revert "long planner: allow throttle reflects usage (#33792)"

* Revert "Gate acceleration on model gas press predictions (#33643)"

* Reapply "Gate acceleration on model gas press predictions (#33643)"

This reverts commit 76b08e37cb.

* Reapply "long planner: allow throttle reflects usage (#33792)"

This reverts commit c75244ca4e.

* Reapply "Fix low-speed allow_throttle behavior in long planner (#33894)"

This reverts commit b2b7d21b7b.

* Reapply "Long planner get accel: new function args (#34288)"

This reverts commit 74dca2fccf.

* don't need

* retain snpe

* wrong

* they're symlinks

* remove

* put back into VCS

* add back

* don't include built

* Refactor model runner retrieval with caching support

Added caching for active model runner type via `ModelRunnerTypeCache` to enhance performance and avoid redundant checks. Introduced a `force_check` flag to bypass the cache when necessary. Updated related code to handle cache clearing during onroad transitions.

* Update model runner determination logic with caching fix

Enhances `get_active_model_runner` to utilize caching more effectively by ensuring type consistency and updating cache only when necessary. Also updates `is_snpe_model` to pass the `started` state to the runner determination function, improving behavior for dynamic checks.

* default to none

* enable in next PR

* more

---------

Co-authored-by: DevTekVE <devtekve@gmail.com>
2025-01-10 18:34:06 -05:00

105 lines
2.4 KiB
C++

//=============================================================================
//
// Copyright (c) 2017, 2020 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
//
//=============================================================================
#ifndef PLATFORM_STANDARD_STRING_HPP
#define PLATFORM_STANDARD_STRING_HPP
#include <cstdio>
#include <string>
#include <ostream>
#include "DlSystem/ZdlExportDefine.hpp"
namespace zdl
{
namespace DlSystem
{
/** @addtogroup c_plus_plus_apis C++
@{ */
/**
* @brief .
*
* Class for wrapping char * as a really stripped down std::string replacement.
*/
class ZDL_EXPORT String final
{
public:
String() = delete;
/**
* Construct a string from std::string reference.
* @param str Reference to a std::string
*/
explicit String(const std::string& str);
/**
* Construct a string from char* reference.
* @param a char*
*/
explicit String(const char* str);
/**
* move constructor.
*/
String(String&& other) noexcept;
/**
* copy constructor.
*/
String(const String& other) = delete;
/**
* assignment operator.
*/
String& operator=(const String&) = delete;
/**
* move assignment operator.
*/
String& operator=(String&&) = delete;
/**
* class comparators
*/
bool operator<(const String& rhs) const noexcept;
bool operator>(const String& rhs) const noexcept;
bool operator<=(const String& rhs) const noexcept;
bool operator>=(const String& rhs) const noexcept;
bool operator==(const String& rhs) const noexcept;
bool operator!=(const String& rhs) const noexcept;
/**
* class comparators against std::string
*/
bool operator<(const std::string& rhs) const noexcept;
bool operator>(const std::string& rhs) const noexcept;
bool operator<=(const std::string& rhs) const noexcept;
bool operator>=(const std::string& rhs) const noexcept;
bool operator==(const std::string& rhs) const noexcept;
bool operator!=(const std::string& rhs) const noexcept;
const char* c_str() const noexcept;
~String();
private:
char* m_string;
};
/**
* overloaded << operator
*/
ZDL_EXPORT std::ostream& operator<<(std::ostream& os, const String& str) noexcept;
} // DlSystem namespace
} // zdl namespace
/** @} */ /* end_addtogroup c_plus_plus_apis C++ */
#endif // PLATFORM_STANDARD_STRING_HPP