本文整理汇总了C++中debug_out函数的典型用法代码示例。如果您正苦于以下问题:C++ debug_out函数的具体用法?C++ debug_out怎么用?C++ debug_out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debug_out函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: filterGraph
SplitState filterGraph(PartitionStack* ps, const GraphType& points,
const CellList& cells, int path_length)
{
// Would not normally go this low level, but it is important this is fast
memset(&(mset.front()), 0, mset.size() * sizeof(mset[0]));
edgesconsidered = 0;
MonoSet monoset(ps->cellCount());
debug_out(3, "EdgeGraph", "filtering: " << cells.size() << " cells out of " << ps->cellCount());
if(path_length == 1) {
for(int c : cells)
{
hashCellSimple(ps, points, monoset, c);
}
}
else
{
MonoSet hitvertices(ps->domainSize());
for(int c : cells)
{
hashRangeDeep(ps, points, monoset, hitvertices, ps->cellRange(c));
}
memset(&(msetspare.front()), 0, msetspare.size() * sizeof(msetspare[0]));
hashRangeDeep2(ps, points, monoset, hitvertices.getMembers());
for(int i : range1(mset.size())) {
mset[i] += msetspare[i] * 71;
}
}
debug_out(3, "EdgeGraph", "filtering " << mset << " : " << monoset);
return filterPartitionStackByFunctionWithCells(ps, SquareBrackToFunction(&mset), monoset);
}
示例2: debug_out
int Theme::populateANYThemes(Fl_Browser *o,std::string checkHERE,bool backone){
debug_out("int populateANYThemes(Fl_Browser *o,std::string "+checkHERE+",bool backone)");
if(backone){o->add("..");}
DIR *dir=NULL;
std::string itemName;
struct dirent *ent=NULL;
if ((dir = opendir (checkHERE.c_str())) != NULL) {
while ((ent = readdir (dir)) != NULL) {
itemName=ent->d_name;
std::string fullpath=ent->d_name;
itemName=itemName.substr(0,(itemName.length()));
if (!(itemName.compare(".")==0)&&!(itemName.compare("..")==0)&&!(itemName.compare("old")==0)&&!(itemName.compare("2.3.0")==0)){
//Don't add our random stuff
if( (!linuxcommon::has_file_extention_at_end(itemName,".in")) && !linuxcommon::has_file_extention_at_end(itemName,".txt") ){
pugi::xml_document tmp;
if(checkHERE.rfind('/')!=checkHERE.length()-1){checkHERE+="/";}
std::string subber = checkHERE+fullpath;
fullpath=checkHERE+fullpath+"/"+fullpath;
debug_out(fullpath);
if( (tmp.load_file(fullpath.c_str())) || (tmp.load_file( subber.c_str())) ){
o->add(itemName.c_str());
}
}
}
}
if(dir!=NULL){closedir (dir);}
}
else {
perror ("");
return EXIT_FAILURE;
}
return 0;
}
示例3: filterPartitionStackByUnorderedFunction
SplitState filterPartitionStackByUnorderedFunction(PartitionStack* ps, F f)
{
debug_out(3, "filterUnFun", "prestate " << ps->printCurrentPartition());
int cellCount = ps->cellCount();
// first of all, we need to try to distinguish as many values of F as possible.
std::map<typename F::result_type, HashType> full_hash;
for(int i : range1(cellCount))
{
typedef std::map<typename F::result_type, unsigned> map_type;
map_type count_map;
for(int x : ps->cellRange(i))
{
count_map[f(x)]++;
}
for(const auto& m : count_map)
{
full_hash[m.first] = hash_combine(full_hash[m.first], i, m.second);
}
}
debug_out(3, "filter", "Hash:" << full_hash);
debug_out(3, "filter", "Function:" << f);
SplitState ret = filterPartitionStackByFunction(ps, IndirectFunction(MapToFunction(&full_hash), f));
debug_out(3, "filterUnFun", "poststate " << ps->printCurrentPartition());
return ret;
}
示例4: debug_out
void JSM_Menu::listMenus(Fl_Browser* list_browser){
debug_out("void listMenus(Fl_Browser* o)");
list_browser->clear();
std::string tempString,convertString,tempString2,convertString2,attributeValue,test1,test2;
if(newStyle() == -1){
for (int i = 0; i<=9;i++){
convertString = convert(i);
if(!isRootMenu(convertString)){
debug_out("Adding: "+convertString);
list_browser->add(convertString.c_str());
}
}
}
else{
debug_out("New Style Menu");
for(char i = '0';i<='z';i++){
convertString=i;
if((i < ':')||(i > '`')){
if(!isRootMenu(convertString)){
debug_out("Adding: "+convertString);
list_browser->add(convertString.c_str());
}
}
}
}
list_browser->redraw();
}
示例5: addSolution
void addSolution(const Permutation& sol)
{
permutations.push_back(sol);
D_ASSERT(sol.size() == orbit_mins.size());
debug_out(3, "SS", "Old orbit_mins:" << orbit_mins);
for(int i : range1(sol.size()))
{
if(sol[i] != i)
{
int val1 = walkToMinimum(i);
int val2 = walkToMinimum(sol[i]);
int orbit_min = -1;
if(comparison(val1, val2))
orbit_min = val1;
else
orbit_min = val2;
update_orbit_mins(orbit_min, val1);
update_orbit_mins(orbit_min, val2);
update_orbit_mins(orbit_min, i);
update_orbit_mins(orbit_min, sol[i]);
}
}
debug_out(1, "SS", "Solution found");
debug_out(3, "SS", "Sol:" << sol);
debug_out(3, "SS", "New orbit_mins:" << orbit_mins);
}
示例6: debug_out
// This may throw for invalid domain or level.
std::ostream& debug_out(debug_level::flag level, const std::string& domain)
{
debug_internal::DebugState::domain_map_t& dm = debug_internal::get_debug_state().get_domain_map();
debug_internal::DebugState::domain_map_t::iterator level_map = dm.find(domain);
if (level_map == dm.end()) { // no such domain
std::string msg = "debug_out(): Debug state doesn't contain the requested domain: \"" + domain + "\".";
if (domain != "default") {
debug_out(debug_level::warn, "default") << msg << "\n";
debug_out(debug_level::info, "default") << "Auto-creating the missing domain.\n";
debug_register_domain(domain);
debug_out(debug_level::warn, "default") << "The message follows:\n";
return debug_out(level, domain); // try again
}
// this is an internal error
THROW_FATAL(debug_internal_error(msg.c_str()));
}
debug_internal::DebugState::level_map_t::iterator os = level_map->second.find(level);
if (level_map == dm.end()) {
std::string msg = std::string("debug_out(): Debug state doesn't contain the requested level ") +
debug_level::get_name(level) + " in domain: \"" + domain + "\".";
// this is an internal error
THROW_FATAL(debug_internal_error(msg.c_str()));
}
return *(os->second);
}
示例7: filterPartitionStackByUnorderedListFunction
SplitState filterPartitionStackByUnorderedListFunction(PartitionStack* ps, F f)
{
debug_out(3, "filterUnListFun", "prestate " << ps->printCurrentPartition());
int cellCount = ps->cellCount();
// first of all, we need to try to distinguish as many values of F as possible.
std::map<typename F::result_type::value_type, HashType> full_hash;
for(int i : range1(cellCount))
{
typedef std::map<typename F::result_type::value_type, unsigned> map_type;
map_type count_map;
for(int val : ps->cellRange(i))
{
for(const auto& val2 : f(val))
count_map[val2]++;
}
for(const auto& val : count_map)
{
full_hash[val.first] = hash_combine(full_hash[val.first], i, val.second);
}
}
SplitState ret = filterPartitionStackByFunction(ps, IndirectVecCollapseFunction(MapToFunction(&full_hash), f));
debug_out(3, "filterUnListFun", "poststate " << ps->printCurrentPartition());
return ret;
}
示例8: application_start
int application_start(void)
{
mxchipInit();
Platform_Init();
UART_Init();
#ifdef RFLowPowerMode
ps_enable();
#endif
#ifdef MCULowPowerMode
mico_mcu_powersave_config(mxEnable);
#endif
debug_out("\r\n%s\r\nmxchipWNet library version: %s\r\n", APP_INFO, system_lib_version());
debug_out (menu);
debug_out ("\nMXCHIP> ");
while(1) {
Main_Menu();
if(configSuccess){
wNetConfig.wifi_mode = Station;
wNetConfig.dhcpMode = DHCP_Client;
wNetConfig.wifi_retry_interval = 100;
StartNetwork(&wNetConfig);
debug_out("connect to %s.....\r\n", wNetConfig.wifi_ssid);
configSuccess = 0;
debug_out ("\nMXCHIP> ");
}
}
}
示例9: exticonv_local_to_utf8
VALUE exticonv_local_to_utf8(VALUE local_string)
{
#if RJB_RUBY_VERSION_CODE < 190
check_kcode();
if(RTEST(objIconvR2J))
{
return rb_funcall(objIconvR2J, rb_intern("iconv"), 1, local_string);
}
else
{
return local_string;
}
#else
VALUE cEncoding, encoding, utf8;
cEncoding = rb_const_get(rb_cObject, rb_intern("Encoding"));
encoding = rb_funcall(local_string, rb_intern("encoding"), 0);
utf8 = rb_const_get(cEncoding, rb_intern("UTF_8"));
if (encoding != utf8)
{
VALUE ret = rb_funcall(local_string, rb_intern("encode"), 2, utf8, encoding);
#if defined(DEBUG)
debug_out(local_string);
debug_out(ret);
#endif
return ret;
}
else
{
return local_string;
}
#endif
}
示例10: while
/* Calculates the truth value of one lineful of conditions. Returns
the point just before the end of line. */
static char *test_line (WEdit *edit_widget, char *p, int *result)
{
int condition;
char operator;
char *debug_start, *debug_end;
/* Repeat till end of line */
while (*p && *p != '\n') {
/* support quote space .mnu */
while ((*p == ' ' && *(p-1) != '\\' ) || *p == '\t')
p++;
if (!*p || *p == '\n')
break;
operator = *p++;
if (*p == '?'){
debug_flag = 1;
p++;
}
/* support quote space .mnu */
while ((*p == ' ' && *(p-1) != '\\' ) || *p == '\t')
p++;
if (!*p || *p == '\n')
break;
condition = 1; /* True by default */
debug_start = p;
p = test_condition (edit_widget, p, &condition);
debug_end = p;
/* Add one debug statement */
debug_out (debug_start, debug_end, condition);
switch (operator){
case '+':
case '=':
/* Assignment */
*result = condition;
break;
case '&': /* Logical and */
*result &= condition;
break;
case '|': /* Logical or */
*result |= condition;
break;
default:
debug_error = 1;
break;
} /* switch */
/* Add one debug statement */
debug_out (&operator, NULL, *result);
} /* while (*p != '\n') */
/* Report debug message */
debug_out (NULL, NULL, 1);
if (!*p || *p == '\n')
p --;
return p;
}
示例11: filterCellByFunction_noSortData
SortEvent filterCellByFunction_noSortData(PartitionStack* ps, int cell, F f)
{
// Start at the end, because then the cell we pass to
// split remains the same.
int cellBegin = ps->cellStartPos(cell);
int cellEnd = ps->cellEndPos(cell);
// Cheap pass to check if all cells have the same value
HashType first_val = f(ps->val(cellBegin));
bool allequal = true;
for(int pos = cellBegin + 1; pos < cellEnd && allequal; ++pos)
{
if(first_val != (HashType)f(ps->val(pos)))
allequal = false;
}
if(allequal)
{
SortEvent se(cellBegin, cellEnd);
debug_out(3, "filter", "all hashes equal: " + toString(first_val));
se.addHashStart(f(ps->val(cellBegin)), cellBegin);
se.finalise();
return se;
}
std::sort(ps->cellStartPtr(cell), ps->cellEndPtr(cell), IndirectSorter(f));
ps->fixCellInverses(cell);
int cellsplits = 0;
SortEvent se(cellBegin, cellEnd);
for(int pos = cellEnd - 2; pos >= cellBegin; --pos)
{
if(f(ps->val(pos)) != f(ps->val(pos+1)))
{
se.addHashStart(f(ps->val(pos+1)),pos+1);
cellsplits++;
if(ps->split(cell, pos+1).hasFailed())
abort();
}
}
// Have to have information about the first cell too!
se.addHashStart(f(ps->val(cellBegin)), cellBegin);
se.finalise();
D_ASSERT(cellsplits > 0);
debug_out(3, "filter", "Succeeded at: " << cell << ", " << cellsplits << " ( " << (cellEnd - cellBegin) << ", " << cellBegin << ", " << cellEnd << ", " << ps->cellCount() << ")\n");
return se;
}
示例12: dbase_clear
/********************************************************************
DBASE_CLEAR
Sletter alle informationer i databaserne
********************************************************************/
void dbase_clear(void)
{
debug_out(" | |==> Cleaning Nick database...\n");
while (nicks_count)
nicks_remove(nicks_num[nicks_count-1]->numeric);
channels_cleanup();
chanserv_dbase_cleanup();
debug_out(" | \\==> Databases successfully removed from memory...\n");
}
示例13: filterPartitionStackByFunction
SplitState filterPartitionStackByFunction(PartitionStack* ps, F f)
{
debug_out(3, "filterByFunction", "prestate " << ps->printCurrentPartition());
SplitState ret(false);
if(ps->getAbstractQueue()->hasSortData())
ret = filterPartitionStackByFunction_withSortData(ps, f);
else
ret = filterPartitionStackByFunction_noSortData(ps, f);
debug_out(3, "filterByFunction", "poststate " << ps->printCurrentPartition() << ":" << ret);
return ret;
}
示例14: server_dump
void server_dump(dbase_server *root, int level)
{
int i;
if ((!root) && (!level)) root = servers;
if (root)
{
for (i = 0; i < level; i++) debug_out("| ");
debug_out("%s (%s) - %s\n", root->name, root->numeric, root->desc);
for (i = 0; i < root->children_count; i++)
server_dump(root->children[i], level+1);
}
}
示例15: InitializeEventHandler_Send
void InitializeEventHandler_Send( void )
{
key_t key;
key = ftok( UI_CTRL_PATHNAME, UI_CTRL_PRJ_ID_OWNER_SIP );
if( ( qidEventSip = msgget( key, 0666 | IPC_CREAT ) ) == -1 ) {
debug_out( "Create Sip event queue fail.\n" );
}
debug_out( "qidEventSip: %d (K:%d)\n", qidEventSip, key );
}