当前位置: 首页>>代码示例>>C++>>正文


C++ Author::getName方法代码示例

本文整理汇总了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;
	}
}
开发者ID:Dimysa,项目名称:Laba4,代码行数:13,代码来源:Publish.cpp

示例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";
	}
}
开发者ID:holben,项目名称:Project-5,代码行数:39,代码来源:Project+5.cpp

示例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);
//.........这里部分代码省略.........
开发者ID:robotology-playground,项目名称:yarpmanager2,代码行数:101,代码来源:propertiestable.cpp


注:本文中的Author::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。