Project

General

Profile

Task #4932

[lang][log] Переопределение вывода полей сообщений

Added by Alexander Kamkin almost 5 years ago. Updated almost 5 years ago.

Status:
Resolved
Priority:
Normal
Target version:
Start date:
05/15/2014
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Published in build:
20140522

Description

Вместо чисел хотелось бы видеть пользовательский вывод.

History

#1 Updated by Alexander Kamkin almost 5 years ago

Кстати, насчет индексации поля - сейчас сообщение об ошибке в ней не информативно -- нет ни названия сообщения, ни названия поля:

# 000267 [FAIL] [ASSERTION]: Index is out of bounds (/home/petroch_m/ispras/cpptesk-toolkit//include/hw/field.hpp:172)
# [ERROR] ASSERTION: Index is out of bounds (/home/petroch_m/ispras/cpptesk-toolkit//include/hw/field.hpp:172)

#2 Updated by Alexander Kamkin almost 5 years ago

  • Status changed from New to Open
  • Published in build set to 20140522
#include <iostream>
#include <hw/message.hpp>

enum Cop { READ, WRITE };

std::ostream& operator << (std::ostream &out, Cop cop) {
    switch(cop) {
        case READ:  return out << "read";
        case WRITE: return out << "write";
        default:    return out << "reserved";
    }
}

CPPTESK_MESSAGE(MyMessage) {
public:
    CPPTESK_DECLARE_TYPED_FIELD(Cop, cop, 2);
    CPPTESK_DECLARE_MASKED_FIELD(addr, 32, 0xffffFFF0);
    CPPTESK_DECLARE_FIELD(data, 32);
    CPPTESK_DECLARE_BIT(flag);
    ...
};

#3 Updated by Alexander Kamkin almost 5 years ago

  • Status changed from Open to Resolved

#4 Updated by Alexander Kamkin almost 5 years ago

  • Subject changed from Переопределение вывода полей сообщений to [lang][log] Переопределение вывода полей сообщений

Also available in: Atom PDF