Use keys stored in a namespace instead of string keys for C++

Đang mở
#414 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
developer-experience

Hướng nghiên cứu

Start by locating the property getters, setters, and other checks that compare manually typed strings, then read the relevant handlers to see which keys they use. The issue proposes a PropertyNames.h file under Deltares.Probabilistic/Server/Handlers; done means those keys are defined in a namespace and the affected checks use them consistently.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement Prob lib C++

I propose we move away from using manually typed strings everywhere for property getters, setters and some others, and instead move the exact strings to a file like:
'Deltares.Probabilistic/Server/Handlers/PropertyNames.h'

namespace Deltares::Server::PropertyNames
{
    namespace Common
    {
        inline constexpr const char* Variable = "variable";
        inline constexpr const char* MinValue = "min_value";
        inline constexpr const char* MaxValue = "max_value";
        inline constexpr const char* StartValue = "start_value";
        inline constexpr const char* Intervals = "intervals";
    }
}

Allowing checks to look like this:
if (property_ == PropertyNames::Common::MinValue) { ... }

Ngôn ngữ chính
C++
Star
9
Fork
1
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Deltares/ProbabilisticLibrary

Tất cả issue của Deltares/ProbabilisticLibrary

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.