本文整理汇总了C++中pout函数的典型用法代码示例。如果您正苦于以下问题:C++ pout函数的具体用法?C++ pout怎么用?C++ pout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pout函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: PMap
void PMap(const CellMap& m)
{
// print out map
CellMap::const_iterator it;
pout() << "Cell Map has " << m.size() << " cells\n";
for ( it = m.begin(); it != m.end(); it++)
{
pout() << "cell "; PIV(it->first); pout() << "\n";
pout() << " verts: "; PVec(it->second.vertices); pout() << "\n";
pout() << " tris : "; PVec(it->second.triangles); pout() << "\n";
}
}
开发者ID:dtgraves,项目名称:EBAMRCNS,代码行数:12,代码来源:STLUtil.cpp
示例2: pout
void tool_app_t::mac(const netlist::factory::element_t *e)
{
auto v = plib::psplit(e->param_desc(), ",");
pstring vs;
for (auto s : v)
{
vs += ", " + s.replace_all("+", "").replace_all(".", "_");
}
pout("{1}(name{2})\n", e->name(), vs);
if (v.size() > 0)
{
pout("/*\n");
for (auto s : v)
{
pstring r(s.replace_all("+", "").replace_all(".", "_"));
if (s.startsWith("+"))
pout("{1:10}: Terminal\n",r);
else
pout("{1:10}: Parameter\n", r);
}
pout("*/\n");
}
}
开发者ID:Tauwasser,项目名称:mame,代码行数:23,代码来源:nltool.cpp
示例3: read_drive_database
// Read drive database from file.
bool read_drive_database(const char * path)
{
stdio_file f(path, "r"
#ifdef __CYGWIN__ // Allow files with '\r\n'.
"t"
#endif
);
if (!f) {
pout("%s: cannot open drive database file\n", path);
return false;
}
return parse_drive_database(parse_ptr(f), knowndrives, path);
}
开发者ID:Elastifile,项目名称:smartmontools,代码行数:15,代码来源:knowndrives.cpp
示例4: pout
// Define new AMR level
void AMRLevelPluto::define(AMRLevel* a_coarserLevelPtr,
const ProblemDomain& a_problemDomain,
int a_level,
int a_refRatio)
{
if (s_verbosity >= 3)
{
pout() << "AMRLevelPluto::define " << a_level << endl;
}
// Call inherited define
AMRLevel::define(a_coarserLevelPtr,
a_problemDomain,
a_level,
a_refRatio);
// Get setup information from the next coarser level
if (a_coarserLevelPtr != NULL)
{
AMRLevelPluto* amrGodPtr = dynamic_cast<AMRLevelPluto*>(a_coarserLevelPtr);
if (amrGodPtr != NULL)
{
m_cfl = amrGodPtr->m_cfl;
m_domainLength = amrGodPtr->m_domainLength;
m_refineThresh = amrGodPtr->m_refineThresh;
m_tagBufferSize = amrGodPtr->m_tagBufferSize;
}
else
{
MayDay::Error("AMRLevelPluto::define: a_coarserLevelPtr is not castable to AMRLevelPluto*");
}
}
// Compute the grid spacing
m_dx = m_domainLength / (a_problemDomain.domainBox().bigEnd(0)-a_problemDomain.domainBox().smallEnd(0)+1.);
// Nominally, one layer of ghost cells is maintained permanently and
// individual computations may create local data with more
m_numGhost = 1;
CH_assert(m_patchPluto != NULL);
CH_assert(isDefined());
m_patchPluto->define(m_problem_domain,m_dx,m_level,m_numGhost);
// Get additional information from the patch integrator
m_numStates = m_patchPluto->numConserved();
m_ConsStateNames = m_patchPluto->ConsStateNames();
m_PrimStateNames = m_patchPluto->PrimStateNames();
}
开发者ID:aywander,项目名称:pluto-outflows,代码行数:51,代码来源:AMRLevelPluto.cpp
示例5: pout
// ---------------------------------------------------------------
void
AMRNavierStokes::writeCheckpointHeader(HDF5Handle& a_handle) const
{
if (s_verbosity >= 3)
{
pout() << "AMRNavierStokes::writeCheckpointHeader" << endl;
}
HDF5HeaderData header;
// since number of velocity components is obviously SpaceDim,
// only need to do number of scalar components here
CH_assert (s_num_vel_comps == SpaceDim);
header.m_int["num_components"] = s_num_scal_comps;
char comp_str[30];
for (int comp=0; comp<s_num_scal_comps; ++comp)
{
sprintf (comp_str, "component_%d", comp);
header.m_string[comp_str] = s_scal_names[comp];
}
// now write lambda name
header.m_string["lambda_component"] = "lambda";
// now write velocity names..
for (int comp=0; comp<s_num_vel_comps; ++comp)
{
sprintf (comp_str, "vel_component_%d", comp);
header.m_string[comp_str] = s_vel_names[comp];
}
header.writeToFile(a_handle);
if (s_verbosity >= 3)
{
pout () << header << endl;
}
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:38,代码来源:AMRNavierStokesIO.cpp
示例6: main
int
main(void)
{
static const char *pcap_files[] = {
"../../sample/icmp.pcap",
"../../sample/tcp.pcap",
"../../sample/udp.pcap",
"../../sample/tcp6.pcap",
"../../sample/udp6.pcap",
};
pout("peak packet test suite... ");
/* make sure this is always aligned to 8 bytes */
assert(!(sizeof(struct peak_packet) % sizeof(uint64_t)));
memset(&net_saddr4, 0, sizeof(net_saddr4));
memset(&net_daddr4, 0, sizeof(net_daddr4));
memset(&net_saddr6, 0, sizeof(net_saddr6));
memset(&net_daddr6, 0, sizeof(net_daddr6));
netaddr4(&net_saddr4, be32dec(&src_ip4));
netaddr4(&net_daddr4, be32dec(&dst_ip4));
netaddr6(&net_saddr6, src_ip6);
netaddr6(&net_daddr6, dst_ip6);
test_icmp(pcap_files[0]);
test_transport_ip4(pcap_files[1]); /* TCP over IPv4 */
test_transport_ip4(pcap_files[2]); /* UDP over IPv4 */
test_transport_ip6(pcap_files[3]); /* TCP over IPv6 */
test_transport_ip6(pcap_files[4]); /* UDP over IPv6 */
pout("ok\n");
return (0);
}
开发者ID:chelongar,项目名称:libpeak,代码行数:36,代码来源:packet.c
示例7: gather_memory_from_procs
// Maintain backward compatibility in code.
// Can now use reduce_print_avg_min_max("label", value);
void gather_memory_from_procs(Real end_memory,
Real &avg_memory,
Real &min_memory,
Real &max_memory)
{
reduce_avg_min_max(end_memory, avg_memory, min_memory, max_memory);
// results only need to be on rank0 (and are)
if (procID() == 0)
{
pout() << "Gather end memory from procs: avg: " << avg_memory
<< " min: " << min_memory
<< " max: " << max_memory << " (MB)\n";
}
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:17,代码来源:memusage.cpp
示例8: QuickScan_Email
void QuickScan_Email(void)
{
int FoundMsg = FALSE;
int i;
char temp[81];
iLineCount = 2;
WhosDoingWhat(READ_POST, NULL);
if (EmailBase.Total == 0) {
Enter(1);
/* There are no messages in this area. */
pout(WHITE, BLACK, (char *) Language(205));
Enter(2);
sleep(3);
return;
}
clear();
/* # From To Subject */
poutCR(YELLOW, BLUE, (char *) Language(220));
if (Msg_Open(sMailpath)) {
for (i = EmailBase.Lowest; i <= EmailBase.Highest; i++) {
if (Msg_ReadHeader(i)) {
snprintf(temp, 81, "%-6u", Msg.Id);
pout(WHITE, BLACK, temp);
snprintf(temp, 81, "%s ", padleft(Msg.From, 20, ' '));
pout(CYAN, BLACK, temp);
snprintf(temp, 81, "%s ", padleft(Msg.To, 20, ' '));
pout(GREEN, BLACK, temp);
snprintf(temp, 81, "%s", padleft(Msg.Subject, 31, ' '));
pout(MAGENTA, BLACK, temp);
Enter(1);
FoundMsg = TRUE;
if (LC(1))
break;
}
}
Msg_Close();
}
if(!FoundMsg) {
Enter(1);
/* There are no messages in this area. */
pout(LIGHTGREEN, BLACK, (char *) Language(205));
Enter(2);
sleep(3);
}
iLineCount = 2;
Pause();
}
开发者ID:bbs-io,项目名称:mbse,代码行数:55,代码来源:email.c
示例9: safeBarrier
//-----------------------------------------------------------------------------
// Function : safeBarrier
// Purpose : This barrier will exit cleanly in parallel if one PE exits
// with an error. The region covered is that following a
// previous call to startSafeBarrier
// Special Notes :
// Scope : Public
// Creator : Dave Shirley, PSSi
// Creation Date : 07/18/05
//-----------------------------------------------------------------------------
void safeBarrier(Parallel::Machine comm)
{
// Collect all pending message to the log file.
pout(comm);
unsigned count = get_message_count(MSG_FATAL) + get_message_count(MSG_ERROR);
if (Parallel::is_parallel_run(comm))
Parallel::AllReduce(comm, MPI_SUM, &count, 1);
if (count > 0) {
UserFatal0().die() << "Simulation aborted due to error";
Xyce_exit(-1);
}
}
开发者ID:Xycedev,项目名称:Xyce,代码行数:26,代码来源:N_ERH_ErrorMgr.C
示例10: switch
void
GUIManager::update(const Input::Event& event)
{
switch (event.type)
{
case Input::POINTER_EVENT_TYPE:
mouse_pos.x = int(event.pointer.x);
mouse_pos.y = int(event.pointer.y);
on_pointer_move(mouse_pos.x, mouse_pos.y);
break;
case Input::BUTTON_EVENT_TYPE:
if (event.button.name == PRIMARY_BUTTON)
{
if (event.button.state == Input::BUTTON_PRESSED)
on_primary_button_press(mouse_pos.x, mouse_pos.y);
else if (event.button.state == Input::BUTTON_RELEASED)
on_primary_button_release(mouse_pos.x, mouse_pos.y);
}
else if (event.button.name == SECONDARY_BUTTON)
{
if (event.button.state == Input::BUTTON_PRESSED)
on_secondary_button_press(mouse_pos.x, mouse_pos.y);
else if (event.button.state == Input::BUTTON_RELEASED)
on_secondary_button_release(mouse_pos.x, mouse_pos.y);
}
break;
case Input::AXIS_EVENT_TYPE:
// AxisEvents can be ignored in the GUI, they are handled elsewhere
pout(PINGUS_DEBUG_GUI) << "GUIManager: AxisEvent: " << event.axis.dir << std::endl;
break;
case Input::KEYBOARD_EVENT_TYPE:
on_key_pressed(event.keyboard.key);
break;
case Input::SCROLLER_EVENT_TYPE:
on_scroller_move(event.scroll.x_delta, event.scroll.y_delta);
break;
default:
pwarn (PINGUS_DEBUG_GUI) << "GUIManager: unhandled event type " << event.type << std::endl;
break;
}
}
开发者ID:jcs12311,项目名称:pingus,代码行数:46,代码来源:gui_manager.cpp
示例11: testEBFluxFAB
int
testEBFluxFAB(const EBISBox& a_ebisBox, const Box& a_box)
{
Interval comps(0,0);
IntVectSet ivs(a_box);
EBFluxFAB srcFab( a_ebisBox, a_box, 1);
EBFluxFAB dstFab( a_ebisBox, a_box, 1);
for (int idir = 0; idir < SpaceDim; idir++)
{
//set source fab to right ans
for (FaceIterator faceit(ivs, a_ebisBox.getEBGraph(), idir, FaceStop::SurroundingWithBoundary);
faceit.ok(); ++faceit)
{
srcFab[idir](faceit(), 0) = rightAns(faceit());
}
}
//linearize the data to dst
int sizeFab = srcFab.size(a_box, comps);
unsigned char* buf = new unsigned char[sizeFab];
srcFab.linearOut(buf, a_box, comps);
dstFab.linearIn( buf, a_box, comps);
delete[] buf;
//check the answer
int eekflag = 0;
for (int idir = 0; idir < SpaceDim; idir++)
{
Real tolerance = 0.001;
for (FaceIterator faceit(ivs, a_ebisBox.getEBGraph(), idir, FaceStop::SurroundingWithBoundary);
faceit.ok(); ++faceit)
{
Real correct = rightAns(faceit());
if (Abs(dstFab[idir](faceit(), 0) - correct) > tolerance)
{
pout() << "ivfab test failed at face "
<< faceit().gridIndex(Side::Lo)
<< faceit().gridIndex(Side::Hi) << endl;
eekflag = -4;
return eekflag;
}
}
}
return 0;
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:46,代码来源:linearizationTest.cpp
示例12: divergenceTest
void
divergenceTest()
{
int maxsize;
ParmParse pp;
pp.get("max_grid_size", maxsize);
//make layouts == domain
Box domainBoxFine, domainBoxCoar;
Real dxFine, dxCoar;
sphereGeometry(domainBoxFine, dxFine);
domainBoxCoar = coarsen(domainBoxFine, 2);
//debug
dxFine = 1.0;
dxCoar = 2.*dxFine;
Vector<Box> boxFine;
domainSplit(domainBoxFine, boxFine, maxsize);
Vector<int> proc(boxFine.size(), 0);
DisjointBoxLayout dblFine(boxFine, proc);
DisjointBoxLayout dblCoar;
coarsen(dblCoar, dblFine, 2);
LevelData<EBCellFAB> errorFine, errorCoar;
EBISLayout ebislFine, ebislCoar;
const EBIndexSpace* const ebisPtr = Chombo_EBIS::instance();
ebisPtr->fillEBISLayout(ebislFine, dblFine, domainBoxFine, 2);
ebisPtr->fillEBISLayout(ebislCoar, dblCoar, domainBoxCoar, 2);
getError(errorFine, ebislFine, dblFine, dxFine);
getError(errorCoar, ebislCoar, dblCoar, dxCoar);
for (DataIterator dit= dblFine.dataIterator(); dit.ok(); ++dit)
{
const EBCellFAB& errorFineFAB = errorFine[dit()];
const EBCellFAB& errorCoarFAB = errorCoar[dit()];
int i1 = errorFineFAB.getMultiCells().numPts();
int i2 = errorCoarFAB.getMultiCells().numPts();
pout() << i1 << i2 << endl;
}
compareError(errorFine, ebislFine, dblFine, domainBoxFine,
errorCoar, ebislCoar, dblCoar, domainBoxCoar);
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:46,代码来源:levelDivTest.cpp
示例13: intlog_binning
void intlog_binning(deque<int> c, int number_of_bins, string file) {
DD Xs;
DD Ys;
DD var;
char b[file.size()+1];
cast_string_to_char(file, b);
ofstream pout(b);
intlog_binning(c, number_of_bins, Xs, Ys, var);
RANGE_loop(i, Xs) {
pout<<Xs[i]<<" "<<Ys[i]<<" "<<var[i]<<endl;
}
}
开发者ID:RoyZhengGao,项目名称:CommunityEvaluation,代码行数:18,代码来源:histograms.cpp
示例14: skip_white
// Skip whitespace and comments.
static parse_ptr skip_white(parse_ptr src, const char * path, int & line)
{
for ( ; ; ++src) switch (*src) {
case ' ': case '\t':
continue;
case '\n':
++line;
continue;
case '/':
switch (src[1]) {
case '/':
// skip '// comment'
++src; ++src;
while (*src && *src != '\n')
++src;
if (*src)
++line;
break;
case '*':
// skip '/* comment */'
++src; ++src;
for (;;) {
if (!*src) {
pout("%s(%d): Missing '*/'\n", path, line);
return src;
}
char c = *src; ++src;
if (c == '\n')
++line;
else if (c == '*' && *src == '/')
break;
}
break;
default:
return src;
}
continue;
default:
return src;
}
}
开发者ID:Elastifile,项目名称:smartmontools,代码行数:45,代码来源:knowndrives.cpp
示例15: CH_assert
// Things to do after initialization
void AMRLevelPluto::postInitialize()
{
CH_assert(allDefined());
if (s_verbosity >= 3)
{
pout() << "AMRLevelPluto::postInitialize " << m_level << endl;
}
if (m_hasFiner)
{
// Volume weighted average from finer level data
AMRLevelPluto* amrGodFinerPtr = getFinerLevel();
amrGodFinerPtr->m_coarseAverage.averageToCoarse(m_UNew,
amrGodFinerPtr->m_UNew);
}
}
开发者ID:aywander,项目名称:pluto-outflows,代码行数:20,代码来源:AMRLevelPluto.cpp
示例16: peek_report
static void
peek_report(const struct peak_packet *packet, const struct peak_track *flow,
const timeslice_t *timer)
{
unsigned int i;
for (i = 0; i < use_count; ++i) {
if (i) {
pout(", ");
}
switch (use_print[i]) {
case USE_APP:
pout("app: %s", peak_li_name(peak_li_merge(flow->li)));
break;
case USE_APP_LEN:
pout("app_len: %hu", packet->app_len);
break;
case USE_FLOW:
pout("flow: %llu", (unsigned long long)flow->id);
break;
case USE_IP_LEN:
pout("ip_len: %hu", packet->net_len);
break;
case USE_IP_TYPE:
pout("ip_type: %hhu", packet->net_type);
break;
case USE_TIME: {
char tsbuf[40];
pout("time: %s", strftime(tsbuf, sizeof(tsbuf),
"%a %F %T", &timer->gmt) ? tsbuf : "???");
break;
}
default:
break;
}
}
pout("\n");
}
开发者ID:dassencio,项目名称:libpeak,代码行数:40,代码来源:peek.c
示例17: lookup_drive_apply_presets
// Searches drive database and sets preset vendor attribute
// options in defs and firmwarebugs.
// Values that have already been set will not be changed.
// Returns pointer to database entry or nullptr if none found
const drive_settings * lookup_drive_apply_presets(
const ata_identify_device * drive, ata_vendor_attr_defs & defs,
firmwarebug_defs & firmwarebugs)
{
// get the drive's model/firmware strings
char model[MODEL_STRING_LENGTH+1], firmware[FIRMWARE_STRING_LENGTH+1];
ata_format_id_string(model, drive->model, sizeof(model)-1);
ata_format_id_string(firmware, drive->fw_rev, sizeof(firmware)-1);
// Look up the drive in knowndrives[].
const drive_settings * dbentry = lookup_drive(model, firmware);
if (!dbentry)
return 0;
if (*dbentry->presets) {
// Apply presets
if (!parse_presets(dbentry->presets, defs, firmwarebugs))
pout("Syntax error in preset option string \"%s\"\n", dbentry->presets);
}
return dbentry;
}
开发者ID:Elastifile,项目名称:smartmontools,代码行数:25,代码来源:knowndrives.cpp
示例18: main
int main(int argc, char** argv) {
double genotype[] = {0, 2, -9, 2, 2, 2, 2, -9, 1,
2, 2, 2, 2, 1, 1, -9, -9, 0};
SimpleMatrix m; // marker by sample matrix
m.resize(3, 6);
int offset = 0;
for (int i = 0; i < m.nrow(); ++i) {
for (int j = 0; j < m.ncol(); ++j) {
m[i][j] = genotype[offset];
++offset;
}
}
std::vector<std::string> iid;
char buf[128];
for (int i = 0; i < m.ncol(); ++i) {
sprintf(buf, "%d", i + 1);
iid.push_back(buf);
}
std::vector<double> pheno;
pheno.push_back(-9);
pheno.push_back(-9);
pheno.push_back(2);
pheno.push_back(-9);
pheno.push_back(2);
pheno.push_back(2);
PlinkOutputFile pout("testPlinkOutputFile.output");
pout.writeFAM(iid, iid, pheno);
pout.writeBIM("1", "snp1", 0, 1, "G", "A");
pout.writeBIM("1", "snp2", 0, 2, "1", "2");
pout.writeBIM("1", "snp3", 0, 3, "A", "C");
pout.writeBED(&m, m.ncol(), m.nrow());
fprintf(stderr, "Done\n");
return 0;
}
开发者ID:marisacgarre,项目名称:rvtests,代码行数:40,代码来源:testPlinkOutputFile.cpp
示例19: GetItemsSubChunk
bool GetItemsSubChunk(WDL_FastString* _in, WDL_FastString* _out, int _tmpltIdx)
{
if (_in && _in->GetLength() && _out && _in!=_out)
{
_out->Set("");
// truncate to the track #_tmpltIdx found in the template
SNM_ChunkParserPatcher p(_in);
if (p.GetSubChunk("TRACK", 1, _tmpltIdx, _out) >= 0)
{
//JFB!! to update with SNM_ChunkParserPatcher v2
// ex: return (p->GetSubChunk("ITEM", 2, -1, _outSubChunk) >= 0); // -1 to get all items in one go
SNM_ChunkParserPatcher pout(_out);
int posItems = pout.GetSubChunk("ITEM", 2, 0); // no breakKeyword possible here: chunk ends with items
if (posItems >= 0) {
_out->Set((const char*)(pout.GetChunk()->Get()+posItems), pout.GetChunk()->GetLength()-posItems-2); // -2: ">\n"
return true;
}
}
}
return false;
}
开发者ID:AusRedNeck,项目名称:sws,代码行数:22,代码来源:SnM_Track.cpp
示例20: DownloadDirect
/*
* Function will download a specific file
*/
int DownloadDirect(char *Name, int Wait)
{
int rc = 0;
int Size;
down_list *dl = NULL;
if ((Size = file_size(Name)) == -1) {
WriteError("No file %s", Name);
pout(CFG.HiliteF, CFG.HiliteB, (char *)"File not found");
Enter(2);
Pause();
}
Syslog('+', "Download direct %s", Name);
add_download(&dl, Name, basename(Name), 0, Size, FALSE);
WhosDoingWhat(DOWNLOAD, NULL);
if ((rc = download(dl))) {
/*
* Error
*/
Syslog('+', "Download failed rc=%d", rc);
poutCR(LIGHTRED, BLACK, (char *)Language(353));
} else {
/*
* Update the users record. The file is free, so only statistics.
*/
ReadExitinfo();
exitinfo.Downloads++; /* Increase download counter */
mib_downloads++;
WriteExitinfo();
}
if (Wait)
Pause();
return rc;
}
开发者ID:bbs-io,项目名称:mbse,代码行数:41,代码来源:file.c
注:本文中的pout函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论