text.cc (6004:97660425ff39) text.cc (6125:3bbbdd324a60)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 345 unchanged lines hidden (view full) ---

354 Counter min;
355 Counter max;
356 Counter bucket_size;
357 size_type size;
358 bool fancy;
359
360 const DistData &data;
361
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 345 unchanged lines hidden (view full) ---

354 Counter min;
355 Counter max;
356 Counter bucket_size;
357 size_type size;
358 bool fancy;
359
360 const DistData &data;
361
362 DistPrint(const DistInfoBase &info);
363 DistPrint(const VectorDistInfoBase &info, int i);
364 void init(const Info &info, const DistParams *params);
362 DistPrint(const Text *text, const DistInfoBase &info);
363 DistPrint(const Text *text, const VectorDistInfoBase &info, int i);
364 void init(const Text *text, const Info &info, const DistParams *params);
365 void operator()(ostream &stream) const;
366};
367
365 void operator()(ostream &stream) const;
366};
367
368DistPrint::DistPrint(const DistInfoBase &info)
368DistPrint::DistPrint(const Text *text, const DistInfoBase &info)
369 : data(info.data)
370{
369 : data(info.data)
370{
371 init(info, safe_cast(info.storageParams));
371 init(text, info, safe_cast<const DistParams *>(info.storageParams));
372}
373
372}
373
374DistPrint::DistPrint(const VectorDistInfoBase &info, int i)
374DistPrint::DistPrint(const Text *text, const VectorDistInfoBase &info, int i)
375 : data(info.data[i])
376{
375 : data(info.data[i])
376{
377 init(info, safe_cast(info.storageParams));
377 init(text, info, safe_cast<const DistParams *>(info.storageParams));
378
379 name = info.name + "_" +
380 (info.subnames[i].empty() ? (to_string(i)) : info.subnames[i]);
381
382 if (!info.subdescs[i].empty())
383 desc = info.subdescs[i];
384}
385
386void
378
379 name = info.name + "_" +
380 (info.subnames[i].empty() ? (to_string(i)) : info.subnames[i]);
381
382 if (!info.subdescs[i].empty())
383 desc = info.subdescs[i];
384}
385
386void
387DistPrint::init(const Info &info, const DistParams *params)
387DistPrint::init(const Text *text, const Info &info, const DistParams *params)
388{
389 name = info.name;
390 desc = info.desc;
391 flags = info.flags;
388{
389 name = info.name;
390 desc = info.desc;
391 flags = info.flags;
392 compat = compat;
393 descriptions = descriptions;
394 precision = info.precision;
392 precision = info.precision;
393 compat = text->compat;
394 descriptions = text->descriptions;
395
396 fancy = params->fancy;
397 min = params->min;
398 max = params->max;
399 bucket_size = params->bucket_size;
400 size = params->buckets;
401}
402

--- 277 unchanged lines hidden (view full) ---

680}
681
682void
683Text::visit(const DistInfoBase &info)
684{
685 if (noOutput(info))
686 return;
687
395
396 fancy = params->fancy;
397 min = params->min;
398 max = params->max;
399 bucket_size = params->bucket_size;
400 size = params->buckets;
401}
402

--- 277 unchanged lines hidden (view full) ---

680}
681
682void
683Text::visit(const DistInfoBase &info)
684{
685 if (noOutput(info))
686 return;
687
688 DistPrint print(info);
688 DistPrint print(this, info);
689 print(*stream);
690}
691
692void
693Text::visit(const VectorDistInfoBase &info)
694{
695 if (noOutput(info))
696 return;
697
698 for (off_type i = 0; i < info.size(); ++i) {
689 print(*stream);
690}
691
692void
693Text::visit(const VectorDistInfoBase &info)
694{
695 if (noOutput(info))
696 return;
697
698 for (off_type i = 0; i < info.size(); ++i) {
699 DistPrint print(info, i);
699 DistPrint print(this, info, i);
700 print(*stream);
701 }
702}
703
704void
705Text::visit(const FormulaInfoBase &info)
706{
707 visit((const VectorInfoBase &)info);

--- 23 unchanged lines hidden ---
700 print(*stream);
701 }
702}
703
704void
705Text::visit(const FormulaInfoBase &info)
706{
707 visit((const VectorInfoBase &)info);

--- 23 unchanged lines hidden ---