c++ÓÚpython»ìºÏϵͳµÄÒ»¸öÄÑÌâ
ÕâÊÇÒ»¸öÆÕͨµÄ»ìºÏʹÓ÷½Ê½, µ«ÕâÖÖ·½Ê½²»ÄÜ´ïµ½½Å±¾ÕæÕýµÄÁé»îÐÔ£¬ c++ÿ¸öÊôÐÔ±ØÐë°ó¶¨Ò»¸öΨһµÄsetºÍget½Ó¿ÚÌṩ¸øpythonÄÚ²¿·ÃÎÊÕâ¸öÊôÐÔ
C/C++ code:
class sample
{
public:
int m_obj;
int GetValue(){
return m_obj;
}
void SetValue(int v){
m_obj= v;
}
};
class_<sample>("sample")
.add_property("m_obj", &sample::GetValue, &sample::SetValue )
ÎÒ¿´¹ýÒ»¸ö¹«Ë¾×öµÄÒ»¸öϵͳʹÓÃ×Ô¼º¿ª·¢µÄpython²å¼þÄ£¿éʵÏÖÁ˷dz£Áé»îµÄc++Óëpython½»»¥
Õâ¸öϵͳÓÐÒ»¸öÅäÖÃÎļþ£¬ ÆäÖж¨Òå×ÅһЩÊôÐԺͽӿڣ¬ ÔÚϵͳÆô¶¯Ê±»áÈ¥·ÖÎöÕâЩÅäÖÃÈ»ºó°ÑËüÃÇ
½¨Á¢ÔÚpythonÖУ¬ Óû§ÔÚpythonÖжÔÕâЩÅäÖö¨ÒåµÄÊôÐÔ¸³Öµ¶¼»á±»c++Ëù½Ø»ñ
ÏÂÃæÊǰ´ÕÕÎÒµÄÉèÏëÈ¥×ö£¬ µ±È»ÏÂÃæ´úÂë²»ÄÜÔËÐÐ ÒòΪ²»Ö§³ÖÕâÑùµÄ·½Ê½¡£
Óû§ÔÚÅäÖÃÎļþ¶¨ÒåÁË3¸öÊôÐÔ
int obj1, float obj2, string obj3
°ÑËüÃǰ󶨵½Ò»¸öͨÓõĽӿÚÉÏ
.add_property("obj1", &bind(&sample::GetValue, 1), &bind(&sample::SetValue, 1 ) )
.add_property("obj2", &bind(&sample::GetValue, 2), &bind(&sample::SetValue, 2 ) )
.add_property("obj3", &bind(&sample::GetValue, 3), &bind(&sample::SetValue, 3 ) )
class sample
{
public:
Py
Ïà¹ØÎÊ´ð£º
QQȺ 29152388
ÓÑÇéUP
°ï¶¥
up
°ïup
up Ö§³Ö£¡
up jf
...ÄѵÀÓзÖ..?
up up up
Ï£ÍûÓеüӷ֣¬¹þ¹þ¡£
Ö§³Ö£¬ÎÒ¼ÓÁË£¬Ï£ÍûÂ¥Ö÷ÄܼÓÎÒ£¬¹²Í¬Ñ§Ï°¹þ
¼ÓÁË¡£
¶¥ÉÏ£¬Ã¿ÌìÊÕ»ñÒ»µã£¬Ö§³Ö ......
±àÒëÆ÷£ºC-Free4
mysql µ¥¶À°²×°µÄ£¬ÏÖÔÚΪapache+php+mysql¿ÉÒÔʹÓá£
×î½üÔÚÁ·Ï°c£¬c++£»ÏëÓÃc£¬c++Á¬½ÓÏÂÎÒµÄmysql£¬ºÃ¶àµØ·½¶à˵mysql.hÕÒ²»µ½¡£¶øÇÒÎÒmysqlûÓÐËùνµÄincludeÎļþ¼Ð°¡¡£
Íü¸ßÊÖÖ¸µãÒ»¶ ......
SHIFT¼ÓF10ÓëÄǸö¼üÓÒctrl±ßÉϵÄÄǸö¼ü¹¦ÄÜÒ»Ñù£¬ÏëÆÁÕâ¸ö
µ«²»ÖªÒªÔõôдÄǸö×éºÏ¼ü£¡
ÓÐûÄĸö´óÏÀ·ÅÒ»¶ÎÕâ¸öµÄ´úÂë»òдһ¶Î
http://topic.csdn.net/u/20090609/15/7dc9fb70-243f-4070-9cfd-34e48b66e6c6.html
......
ÒÔǰѧ¹ýÌ·ºÆÇ¿µÄÊ飬ÈÏÕæ¿´¹ý¼¸±é£¬ÊéÉϵÄÌâ´ó²¿·Ö×Ô¼º±à¹ý£¬ÏÖÔÚÏë½øÒ»²½Ñ§Ï°C£¬Ó¦¸Ã´ÓÄÄ·½Ãæ×ÅÊÖÄØ£¿ÎÒ×¼±¸¿´CÓëÖ¸Õ룬´ó¼Ò¾õµÃÕâ±¾ÊéÔõôÑù£¿»¹ÊÇ¿´ÆäËüµÄÊ飿
ÄãÓ¦¸ÃÖØÐÂÕÒ¡¶c primer plus¡·Õâ±¾Êé¿´¿´¡£
c ......