| stlgen. "Ç¥ÁØ ÅÛÇø´ ¶óÀ̺귯¸®"(STL) C ++ À¯Çü ÄÁÅ×À̳ÊÀÌÁö¸¸ ´Ù¸¥ ¾ð¾î·Î ÄÚµå »ý¼º |
Áö±Ý ´Ù¿î·Îµå |
stlgen. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~gslondon/
stlgen. ű×
stlgen. ¼³¸í
"Ç¥ÁØ ÅÛÇø´ ¶óÀ̺귯¸®"(STL) C ++ À¯Çü ÄÁÅ×À̳ʸ¦ »ý¼ºÇÏÁö¸¸ ´Ù¸¥ ¾ð¾î·Î ÄÚµå »ý¼º STLGENÀº Perl ¸ðµâ ÀÎ "Standard Template Library"(STL) C ++ À¯Çü ÄÁÅ×À̳ʸ¦ »ý¼ºÇÏÁö¸¸ ´Ù¸¥ ¾ð¾î·Î Äڵ带 »ý¼ºÇÕ´Ï´Ù .SynopsisStlgenÀº C ++ÀÇ Ç¥ÁØ ÅÛÇø´ ¶óÀ̺귯¸® (STL)¸¦ ±â¹ÝÀ¸·ÎÇÕ´Ï´Ù. http://www.cplusplus.com/reference / STL / Â÷ÀÌÁ¡Àº STLGENÀÌ STL ÅÛÇø´ÀÇ ÀνºÅϽº¸¦ ´Ù¸¥ ¾ð¾î·Î »ý¼ºÇÑ´Ù´Â °ÍÀÔ´Ï´Ù. ±âº» ¾ð¾î´Â C.ÀÌ ¾Æ·¡ÀÇ ¿¹Á¦´Â STLGENÀ» »ç¿ëÇÏ¿© list_uint¸¦ »ý¼ºÇÕ´Ï´Ù. (C / H) C ¾ð¾î·Î ÄÚµù µÈ ¸µÅ© µÈ ¸ñ·Ï ÄÁÅ×À̳ʸ¦ ±¸ÇöÇÒ ÆÄÀÏÀ» ±¸ÇöÇÕ´Ï´Ù. #! / usr / bin / perl -w STLGEN »ç¿ë; MY $ inst = stlgen-> »õ (template => list ', instancename =>'uint ', payload => ,); $ inst-> Instantiate ();ÀÌ ÆÄÀÏÀ» main.c ÇÁ·Î±×·¥¿¡¼ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù : #include #include "list_uint.h"int main (void) {struct list_uint_list * myList; myList = list_uint_constructor (); list_uint_push_back (myList, 21); list_uint_push_back (myList, 99); list_uint_push_back (myList, 33); list_uint_push_back (myList, 34); list_uint_push_back (myList, 67); list_uint_push_back (myList, 12); list_uint_push_back (myList, 28); list_uint_push_back (myList, 55); list_uint_push_back (myList, 76); list_uint_sort (myList); PRINTF ( "\ n \ n \ n ÀÌ´Â Á¤·Ä µÈ list \ n"); list_uint_list_dumper (myList); ¹Ýȯ 0; } ÇöÀç Compile ¹× ½ÇÇàÇÒ ¶§ À§ÀÇ C ÇÁ·Î±×·¥Àº ´ÙÀ½°ú °°Àº Ãâ·ÂÀ» »ý¼ºÇÕ´Ï´Ù. ÀÌ°ÍÀº ÁÖ¼Ò 140644360 { 'OfterFirst'marker : // ¿ä¼ÒÀÇ Á¤·Ä µÈ ¸ñ·Ï // ¸ñ·ÏÀÔ´Ï´Ù. 8621018 ÀÌÀü = 0 ´ÙÀ½ = 8621088 uint = 0 »ç¿ëÀÚ ¼ÒÀÚ : // ÁÖ¼Ò 8621088 ´ÙÀ½ = 8621018 ´ÙÀ½ = 8621018 ÁÖ¼Ò 8621038 uint = 12 // ¿ä¼Ò AT ÁÖ¼Ò 8621038 ÀÌÀü = 8621088 ´ÙÀ½ = 8621088 ÁÖ¼Ò = 21 // ¿ä¼Ò Addres 8621098 ÀÌÀü = 8621038 ´ÙÀ½ = 8621038 uint = 28 / ÁÖ¼Ò 8621058 uint = 8621068 uint = 8621068 ¾îµå·¹½º 8621068 ÀÌÀü = 8621058 ´ÙÀ½ = 8621058 ´ÙÀ½ = 86210A8 uint = 86210a8 ÀÌÀü = 8621068 ´ÙÀ½ = 8621078 uint = 55 // ¿ä¼Ò AT ÁÖ¼Ò 8621078 PREV = 86210A8 NEXT = 86210B8 ÁÖ¼Ò 86210B8 uint = 86210b8 ÀÌÀü = 8621078 uint = 76 // ¿ä¼Ò AT ÁÖ¼Ò 8621048 ÀÌÀü = 86210B8 ´ÙÀ½ = 86210B8 ´ÙÀ½ = 8621028 uint = 99 'AfterLast'¸¶Ä¿ : // ÁÖ¼Ò 8621028 prev = 8621048 next = 0 uint = 0note : ÀÌ°ÍÀº ¹Ì¸® ¾ËÆÄ VersÀÔ´Ï´Ù ÀÌ¿Â. ÇöÀç ±¸Çö µÈ À¯ÀÏÇÑ STL ÄÁÅ×À̳ʰ¡ ¿¬°áµÈ ¸ñ·ÏÀÔ´Ï´Ù. ±×¸®°í ±×°ÍÀº ¾ÆÁ÷ ¾ÆÁÖ Àß Å×½ºÆ®µÇÁö ¾Ê¾Ò½À´Ï´Ù. "Ǫ½Ã", "ÆË", "Å©±â", "Á¤·Ä"¹× "´ýÆÛ"±â´ÉÀÌ ÀÛµ¿ÇÏ´Â °ÍÀ¸·Î ¾Ë·ÁÁ® ÀÖ½À´Ï´Ù. ¿ä±¸ »çÇ× : ¡¤ Perl.
stlgen. °ü·Ã ¼ÒÇÁÆ®¿þ¾î