本文整理汇总了C++中Author::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Author::getName方法的具体用法?C++ Author::getName怎么用?C++ Author::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Author
的用法示例。
在下文中一共展示了Author::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show
void Publish::show()
{
Author *p = head;
while (p)
{
cout << "Name: " << p->getName() << endl;
cout << "Lastname: " << p->getLastname() << endl;
cout << "Type: Book" << endl;
cout << "Title: " << p->getTitle() << endl;
cout << "Number of pages: " << p->getKol() << endl;
p = p->next;
}
}
示例2: displayBooks
void displayBooks(const vector<Book*>& books)
{
// set up cout to display currency
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
// display heading
cout << "\nRecommended Reading List\n";
// you provide the rest of this code
// display each account
for (int i = 0; i < books.size(); i++)
{
Author* pointer = books[i]->getAuthor();
cout << books[i]->getTitle() << '\n';
cout << pointer->getName() << '\n';
cout << pointer->getAddress() << '\n';
cout << books[i]->getPages() << " pages\n";
// use rtti to see what kind of object is being pointed to, and display the
// appropriate child class data values
AudioBook* bp = dynamic_cast<AudioBook*>(books[i]);
if (bp)
{
cout << "The length of this audio book is " << bp->getAudioLength() << " minutes." << endl;
}
else
{
DigitalBook* bp = dynamic_cast<DigitalBook*>(books[i]);
if (bp)
{
cout << "The format of this digital book is " << bp->getFormat() << endl;
}
} // end else
cout << '$' << books[i]->getPrice() << "\n\n\n";
}
}
示例3: showModuleTab
void PropertiesTable::showModuleTab(Module *mod)
{
modules.clear();
disconnect(moduleProperties,SIGNAL(itemChanged(QTreeWidgetItem*,int)),this,SLOT(onModItemChanged(QTreeWidgetItem*,int)));
disconnect(moduleProperties,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(onModItemDoubleClicked(QTreeWidgetItem*,int)));
currentApplication = NULL;
currentModule = mod;
propertiesTab->clear();
propertiesTab->addTab(moduleProperties,"Module Properties");
propertiesTab->addTab(moduleDescription,"Description");
moduleProperties->clear();
moduleDescription->clear();
appProperties->hide();
moduleProperties->show();
moduleDescription->show();
modName = new QTreeWidgetItem(moduleProperties,QStringList() << "Name" << mod->getName());
modNode = new QTreeWidgetItem(moduleProperties,QStringList() << "Node");
modStdio = new QTreeWidgetItem(moduleProperties,QStringList() << "Stdio" << mod->getStdio());
modWorkDir = new QTreeWidgetItem(moduleProperties,QStringList() << "Workdir" << mod->getWorkDir());
modPrefix = new QTreeWidgetItem(moduleProperties,QStringList() << "Prefix" << mod->getBasePrefix());
modDeployer = new QTreeWidgetItem(moduleProperties,QStringList() << "Deployer");
modParams = new QTreeWidgetItem(moduleProperties,QStringList() << "Parameters" << mod->getParam());
lastPrefix = mod->getBasePrefix();
modStdio->setFlags(modStdio->flags() | Qt::ItemIsEditable);
modWorkDir->setFlags(modWorkDir->flags() | Qt::ItemIsEditable);
modPrefix->setFlags(modPrefix->flags() | Qt::ItemIsEditable);
moduleProperties->addTopLevelItem(modName);
moduleProperties->addTopLevelItem(modNode);
moduleProperties->addTopLevelItem(modStdio);
moduleProperties->addTopLevelItem(modWorkDir);
moduleProperties->addTopLevelItem(modPrefix);
moduleProperties->addTopLevelItem(modDeployer);
moduleProperties->addTopLevelItem(modParams);
if(deployerCombo){
delete deployerCombo;
deployerCombo = NULL;
}
if(nodeCombo){
delete nodeCombo;
nodeCombo = NULL;
}
deployerCombo = new QComboBox();
nodeCombo = new QComboBox();
deployerCombo->setEditable(true);
nodeCombo->setEditable(true);
if(compareString(mod->getBroker(),"yarpdev")){
deployerCombo->addItem("yarpdev");
}else if(compareString(mod->getBroker(),"icubmoddev")){
deployerCombo->addItem("icubmoddev");
}else{
deployerCombo->addItem("local");
deployerCombo->addItem("yarprun");
}
if(strlen(mod->getBroker())){
deployerCombo->setCurrentText(mod->getBroker());
}else if(compareString(mod->getHost(),"localhost")){
deployerCombo->setCurrentText("local");
}
if(mod->getNeedDeployer()){
deployerCombo->setEditable(false);
}
nodeCombo->addItem(mod->getHost());
if(QString(mod->getHost()) != "localhost"){
nodeCombo->addItem("localhost");
}
ResourcePContainer resources = manager->getKnowledgeBase()->getResources();
for(ResourcePIterator itr=resources.begin(); itr!=resources.end(); itr++){
Computer* comp = dynamic_cast<Computer*>(*itr);
if(comp && !compareString(comp->getName(), "localhost")){
nodeCombo->addItem(comp->getName());
}
}
connect(nodeCombo, SIGNAL(editTextChanged(QString)), paramsSignalMapper, SLOT(map()));
connect(nodeCombo, SIGNAL(currentIndexChanged(int)), paramsSignalMapper, SLOT(map()));
paramsSignalMapper->setMapping(nodeCombo,nodeCombo);
connect(deployerCombo, SIGNAL(editTextChanged(QString)), paramsSignalMapper, SLOT(map()));
connect(deployerCombo, SIGNAL(currentIndexChanged(int)), paramsSignalMapper, SLOT(map()));
paramsSignalMapper->setMapping(deployerCombo,deployerCombo);
/*****************************/
// Populate paramters
for(int i=0;i<mod->argumentCount();i++){
Argument a = mod->getArgumentAt(i);
//.........这里部分代码省略.........