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


C++ class_name函数代码示例

本文整理汇总了C++中class_name函数的典型用法代码示例。如果您正苦于以下问题:C++ class_name函数的具体用法?C++ class_name怎么用?C++ class_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了class_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: class_name

static PyObject *UnaryPredicate1D___call__(BPy_UnaryPredicate1D *self, PyObject *args, PyObject *kwds)
{
	static const char *kwlist[] = {"inter", NULL};
	PyObject *py_if1D;

	if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &Interface1D_Type, &py_if1D))
		return NULL;

	Interface1D *if1D = ((BPy_Interface1D *)py_if1D)->if1D;

	if (!if1D) {
		string class_name(Py_TYPE(self)->tp_name);
		PyErr_SetString(PyExc_RuntimeError, (class_name + " has no Interface1D").c_str());
		return NULL;
	}
	if (typeid(*(self->up1D)) == typeid(UnaryPredicate1D)) {
		PyErr_SetString(PyExc_TypeError, "__call__ method not properly overridden");
		return NULL;
	}
	if (self->up1D->operator()(*if1D) < 0) {
		if (!PyErr_Occurred()) {
			string class_name(Py_TYPE(self)->tp_name);
			PyErr_SetString(PyExc_RuntimeError, (class_name + " __call__ method failed").c_str());
		}
		return NULL;
	}
	return PyBool_from_bool(self->up1D->result);
}
开发者ID:Ichthyostega,项目名称:blender,代码行数:28,代码来源:BPy_UnaryPredicate1D.cpp

示例2: get_layer

void
Halftone_TX::activate_layer_textures()
{
   GLSLShader_Layer_Base::activate_layer_textures();

   for (vector<layer_base_t*>::size_type i=0; i<_layers.size(); i++) {
      //main tone correction map
      halftone_layer_t* layer = get_layer(i);
      if (layer->_use_tone_correction) {
         
         if (!activate_texture(
                tone_correction_maps[layer->_tone_correction_tex_stage])
            )
            cerr << class_name()
                 << ": can't activate tone correction texture at stage: "
                 << layer->_tone_correction_tex_stage << endl;
      }

      // forward R function
      if (layer->_use_lod_only) {
         if (!activate_texture(r_function_maps[layer->_r_function_tex_stage]))
            cerr << class_name()
                 << ": can't activate R function texture at stage: "
                 << layer->_r_function_tex_loc << endl;
      }
   }
}
开发者ID:QuLogic,项目名称:jot-lib,代码行数:27,代码来源:haftone_tx.cpp

示例3: tag_name

fsm_env::fsm_env(xcs_config_mgr2& xcs_config)
{
	if (!fsm_env::init)
	{
		if (!xcs_config.exist(tag_name()))
		{
			xcs_utility::error(class_name(), "constructor", "section <" + tag_name() + "> not found", 1);	
		}
		
		try {
			state_bits    = (long) xcs_config.Value(tag_name(), "number of bits");
			states_number = (long) xcs_config.Value(tag_name(), "number of states");
		} catch (const char *attribute) {
			string msg = "attribute \'" + string(attribute) + "\' not found in <" + tag_name() + ">";
			xcs_utility::error(class_name(), "constructor", msg, 1);
		}

		//! look for the init section in the configuration file
		string input_configuration;
		
		if ((states_number%2) == 0)			
			xcs_utility::error(class_name(),"class constructor", "Number of states must be even", 1);
		
		current_state = 0;
		final_state = (states_number-1)/2;
	
		set_state();
	}
	fsm_env::init = true;
}
开发者ID:dathayer23,项目名称:LcsStudio,代码行数:30,代码来源:fsm_env.cpp

示例4: gf_stat

static void gf_stat( obj gf )
{
  int i;
  obj p, k;

  fprintf( foo, "%s status: ",
	   symbol_text( gvec_ref( gf, SLOT(3) ) ) );
  for (i=0; i<4; i++)
    {
      k = gvec_ref( gf, SLOT(i*2) + GF_CACHE_0_K );
      if (truish(k))
	fprintf( foo, " %s", symbol_text(class_name(k)) );
      else
	fprintf( foo, " #f" );
    }
  fprintf( foo, " |" );
  k = gvec_ref( gf, GF_VICTIM_K );
  if (truish(k))
    fprintf( foo, " %s", symbol_text(class_name(k)) );
  else
    fprintf( foo, " #f" );

  fprintf( foo, " |" );
  for (p=gvec_ref(gf,GF_CACHE_OVERFLOW);truish(p);p=gvec_ref(p,0))
    {
      k = gvec_ref(p,SLOT(1));
      fprintf( foo, " %s", symbol_text(class_name(k)) );
    }
  fprintf( foo, "\n" );
}
开发者ID:Fuhuiang,项目名称:rscheme,代码行数:30,代码来源:applyg.c

示例5: exceptionStr

fbstring exception_wrapper::what() const {
  if (item_) {
    return exceptionStr(*item_);
  } else if (eptr_ && eobj_) {
    return class_name() + ": " + eobj_->what();
  } else if (eptr_ && etype_) {
    return class_name();
  } else {
    return class_name();
  }
}
开发者ID:chenbiaolong,项目名称:folly,代码行数:11,代码来源:ExceptionWrapper.cpp

示例6: atomic_base

/*!
Constructor

\param name
name used for error reporting
*/
atomic_base( const std::string&  name) :
index_( class_object().size() )     ,
sparsity_( set_sparsity_enum )
{	CPPAD_ASSERT_KNOWN(
		! thread_alloc::in_parallel() ,
		"atomic_base: constructor cannot be called in parallel mode."
	);
	class_object().push_back(this);
	class_name().push_back(name);
	CPPAD_ASSERT_UNKNOWN( class_object().size() == class_name().size() );
}
开发者ID:bubuker,项目名称:keggle_santa,代码行数:17,代码来源:atomic_base.hpp

示例7: clazz

jboolean ClassMatchModifier::class_match(DebuggerEvent *d_event)
{
  UsingFastOops fast_oops;

  JavaClass::Fast clazz = JavaDebugger::get_object_by_id(d_event->clazz_id());
  TypeSymbol::Fast class_name = clazz().name();
  Symbol::Fast mod_name =  class_match_name(); 

  if (mod_name.is_null() || class_name.is_null())
    return true;

  if (clazz().is_obj_array_class()) {
    juint klass_index = class_name().decode_ushort_at(0);
    JavaClass::Raw klass = Universe::class_from_id(klass_index);
    ObjArrayClass::Raw oac = klass.obj();
    klass = oac().element_class();
    class_name = klass().name();
  } else  if (clazz().is_type_array_class()) {
      // just a basic type array, no match here.
      return false;
  }
  // class names in the VM are not necessarily stored with the current OS
  // file separator character, Win32 can use either type of slash

  if (mod_name().byte_at(0) == '*' ||
      mod_name().byte_at(mod_name().length()-1) == '*') {
    // We have a wildcard match.
    int complen = mod_name().length() - 1;
    int req_start = class_name().length() - complen;
    int mod_start = 0;

    if (req_start < 0) {
      return false;
    } else { 
      if (mod_name().byte_at(0) == '*') {
        // suffix match
        // just compare the end of classname
        mod_start = 1;    // point to just past the '*'
      } else {
        req_start = 0;    // prefix match
      }
      return  (jvm_memcmp(mod_name().utf8_data() + mod_start,
                          class_name().utf8_data() + req_start, complen) == 0);
    }
  } else {
    // not a suffix/prefix match so just compare the two.
    return  mod_name().matches(&class_name());
  }
}
开发者ID:hbao,项目名称:phonemefeaturedevices,代码行数:49,代码来源:VMEventModifier.cpp

示例8: PyErr_SetString

static PyObject *UnaryFunction1DVectorViewShape___call__(BPy_UnaryFunction1DVectorViewShape *self,
                                                         PyObject *args,
                                                         PyObject *kwds)
{
  static const char *kwlist[] = {"inter", NULL};
  PyObject *obj = 0;

  if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &Interface1D_Type, &obj))
    return NULL;

  if (typeid(*(self->uf1D_vectorviewshape)) == typeid(UnaryFunction1D<std::vector<ViewShape *>>)) {
    PyErr_SetString(PyExc_TypeError, "__call__ method not properly overridden");
    return NULL;
  }
  if (self->uf1D_vectorviewshape->operator()(*(((BPy_Interface1D *)obj)->if1D)) < 0) {
    if (!PyErr_Occurred()) {
      string class_name(Py_TYPE(self)->tp_name);
      PyErr_SetString(PyExc_RuntimeError, (class_name + " __call__ method failed").c_str());
    }
    return NULL;
  }

  const unsigned int list_len = self->uf1D_vectorviewshape->result.size();
  PyObject *list = PyList_New(list_len);
  for (unsigned int i = 0; i < list_len; i++) {
    ViewShape *v = self->uf1D_vectorviewshape->result[i];
    PyList_SET_ITEM(list, i, v ? BPy_ViewShape_from_ViewShape(*v) : (Py_INCREF(Py_None), Py_None));
  }

  return list;
}
开发者ID:dfelinto,项目名称:blender,代码行数:31,代码来源:BPy_UnaryFunction1DVectorViewShape.cpp

示例9: class_name

void shade::shaders::VertexToFragmentCopy<T>::init_vertex_inline(formatter::Generator& generator) const
{
  std::string class_name(VertexToFragmentCopy::get_class_name());

  generator.handle_statement_begin();
  generator.handle_function_call_begin();
  generator.handle_function_call_name_begin();
  generator.handle_identifier(class_name+"_set_copy");
  generator.handle_function_call_name_end();
  generator.handle_function_call_parameter_list_begin();
  generator.handle_function_call_parameter_begin();
  generator.handle_identifier("self");
  generator.handle_function_call_parameter_end();
  generator.handle_function_call_parameter_begin();
  {
    generator.handle_function_call_begin();
    generator.handle_function_call_name_begin();
    generator.handle_identifier("Gettable_"+T<Type>().get_uniq_id()+"_get");
    generator.handle_function_call_name_end();
    generator.handle_function_call_parameter_list_begin();
    generator.handle_function_call_parameter_begin();
    generator.handle_identifier("value");
    generator.handle_function_call_parameter_end();
    generator.handle_function_call_parameter_list_end();
    generator.handle_function_call_end();
  }
  generator.handle_function_call_parameter_end();
  generator.handle_function_call_parameter_list_end();
  generator.handle_function_call_end();
  generator.handle_statement_end();
}
开发者ID:4og,项目名称:avango,代码行数:31,代码来源:VertexToFragmentCopy_impl.cpp

示例10: PlotCellTree

void PlotCellTree( TString fin = "weights/TMVAClassification_PDEFoam.weights_foams.root",
		   TString cv_long, bool useTMVAStyle=kTRUE )
{
   // Draw the PDEFoam cell tree

   cout << "read file: " << fin << endl;
   TFile *file = TFile::Open(fin);

   if (useTMVAStyle)  TMVAGlob::SetTMVAStyle();

   // find foams
   TListIter foamIter(gDirectory->GetListOfKeys());
   TKey *foam_key = NULL; // the foam key
   TCanvas *canv = NULL;  // the canvas
   while (foam_key = (TKey*) foamIter()) {
      TString name(foam_key->GetName());
      TString class_name(foam_key->GetClassName());
      if (!class_name.Contains("PDEFoam"))
	 continue;
      cout << "PDEFoam found: " << class_name << " " << name << endl;

      // read the foam
      TMVA::PDEFoam *foam = (TMVA::PDEFoam*) foam_key->ReadObj();
      canv = new TCanvas(Form("canvas_%s",name.Data()),
			 Form("%s of %s",cv_long.Data(),name.Data()), 640, 480);

      // get cell tree depth
      const UInt_t   depth = foam->GetRootCell()->GetTreeDepth();
      const Double_t ystep = 1.0 / depth;
      DrawCell(foam->GetRootCell(), foam, 0.5, 1.-0.5*ystep, 0.25, ystep);
   }

   file->Close();
}
开发者ID:TopBrussels,项目名称:TopTreeAnalysisBase,代码行数:34,代码来源:PlotFoams.C

示例11:

char const * Standard_Low_Level_Exception::plain_what() const
{
    m_buffer=class_name();
    m_buffer+=": ";
    m_buffer+=m_plain_what;
    return m_buffer.c_str();
}
开发者ID:arafato,项目名称:syneight,代码行数:7,代码来源:standard_low_level_exception.cpp

示例12: clear

void PluginChoooserWidget::loadImpl()
{
	clear();
	Config group = Config().group("plugins/list");
	QStandardItem *parent_item = m_model->invisibleRootItem();

    QList<QWeakPointer<Plugin> > plugins = pluginsList();
	QStringList helper;
    for (int i = 0; i < plugins.size(); i++) {
        const PluginInfo &info = plugins.at(i).data()->info();
        QLatin1String class_name(plugins.at(i).data()->metaObject()->className());
        if (!m_plugin_items.contains(info.name())) {
			QIcon icon = info.icon();
			if (icon.isNull() || !icon.availableSizes().count())
				icon = Icon("applications-system");
			QString name = info.name();
			int index = qLowerBound(helper, name) - helper.constBegin();
			helper.insert(index, name);
			ServiceItem *item = new ServiceItem(icon, name);
			item->setToolTip(html(info));
			item->setCheckable(true);
			item->setData(true,ServiceItem::ExclusiveRole);
			item->setData(info.description().toString(), DescriptionRole);
			item->setCheckState((group.value(class_name, true) ? Qt::Checked : Qt::Unchecked));
			parent_item->insertRow(index, item);
			m_plugin_items.insert(class_name, item);
            m_plugins.insert(class_name, plugins.at(i).data());
		}
	}
}
开发者ID:AlexeyProkhin,项目名称:qutim,代码行数:30,代码来源:pluginchooserwidget.cpp

示例13: class_name

CubitString CubitCoordinateSystem::entity_name() const
{
  CubitString name = class_name();
  name += " ";
  name += CubitString( this->id() );
  return name;
}
开发者ID:chrismullins,项目名称:cgma,代码行数:7,代码来源:CubitCoordinateSystem.cpp

示例14: main

int main(int arg_count, char *args[])
{
  generator gen;
  int first_non_flag_index = process_options(gen, arg_count, args);
  int num_non_flag_args = arg_count - first_non_flag_index;

  if(num_non_flag_args != 1 && num_non_flag_args != 2)
  {
    std::cerr << "Usage: cppclassgen --<flags> <class_name> <module_name(optional)>" << std::endl;
    std::exit(-1);
  }

  std::string class_name(args[first_non_flag_index]);
  gen.m_tokens.push_back(std::make_pair("%CLASS_NAME%", class_name));
  auto class_name_upper = toupper(class_name);
  gen.m_tokens.push_back(std::make_pair("%CLASS_NAME_UPPER%", class_name_upper));

  if(num_non_flag_args == 2)
  {
    std::string module_name(args[first_non_flag_index + 1]);
    gen.m_tokens.push_back(std::make_pair("%MODULE_NAME%", module_name));
    toupper(module_name);
    auto module_name_upper = toupper(module_name);
    gen.m_tokens.push_back(std::make_pair("%MODULE_NAME_UPPER%", module_name_upper));
  }

  read_tokens_from_config_file(gen);
  create_new_file_from_template(gen, class_name, ".h");
  create_new_file_from_template(gen, class_name, ".cpp");

  return 0;
}
开发者ID:peter-clark,项目名称:lifeline,代码行数:32,代码来源:main.cpp

示例15: printf

//fix:  We can't we just tell the head to print?  Are nodes not connected
//between chains?  If not, why not?
void ArpIndexedList::Print()
{
	//printf("Printing ArpIndexedList..\n");
	
	if (chain == 0) {
		printf("ArpIndexedList::Print() chain was NULL\n");
		return;
	}

	for(long i=0; i<count; i++) {
		printf("Chain %d", (int)i);
		if (chain[i] == NULL) {
			printf("\tNULL\n");
		} else {
			printf("\n");
			chain[i]->PrintListUntil(NextChainHeadFrom(i+1));
		}
	}		
	if (tailNode == 0) {
		printf("No tail node\n");
	} else {
		const char	*cn = class_name(tailNode);
		if (cn == 0) { printf("Tail node class: No class name\n");
		} else { printf("Tail node class: %s\n", cn); }
		fflush(stdout);

		tailNode->PrintContents();
	}
}
开发者ID:HaikuArchives,项目名称:Sequitur,代码行数:31,代码来源:ArpIndexedList.cpp


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