Главная | Actual Topics | Обратная связь | В избранное | Сделать домашней | Антиспам ;)
 System & Utilities
 Unix News
 OS Emulator
Каталог статей
Все статьи

Биллу Гейтсу тоже предлагают избавиться ...
Вымогательство в борьбе со спамом

November, 2018
Какой из этих ОС Вы отдаете большее предпочтение?

Mac OS
Windows XP
Windows 2003
Что такое ОС? :)

Другие опросы

Всего голосов: 327
Комментарии: 0

Архив Новостей
 November 2018 (3)
 October 2018 (13)
 September 2018 (8)
 August 2018 (8)
 July 2018 (11)
 June 2018 (13)
 May 2018 (10)
 April 2018 (14)
 March 2018 (11)
 February 2018 (13)
 January 2018 (13)
 December 2017 (14)
 November 2017 (15)
 October 2017 (19)
 September 2017 (18)
 August 2017 (13)
 February 2017 (14)
 January 2017 (19)
 December 2016 (16)
 November 2016 (16)
 October 2016 (21)
 September 2016 (18)
 August 2016 (16)
 July 2016 (16)
 June 2016 (20)
 May 2016 (18)
 April 2016 (15)
 March 2016 (22)
 February 2016 (17)
 January 2016 (15)
 December 2015 (15)
 November 2015 (22)
 October 2015 (20)
 September 2015 (17)
 August 2015 (25)
 July 2015 (20)
 June 2015 (23)
 May 2015 (21)
 April 2015 (17)
 March 2015 (19)
 February 2015 (9)
 January 2015 (23)
 December 2014 (9)
 November 2014 (13)
 October 2014 (12)
 September 2014 (18)
 August 2014 (20)
 July 2014 (10)
 June 2014 (12)
 May 2014 (12)
 April 2014 (10)
 March 2014 (22)
 February 2014 (10)
 January 2014 (8)
 December 2013 (26)
 November 2013 (53)
 October 2013 (40)
 September 2013 (48)
 August 2013 (63)
 July 2013 (56)
 June 2013 (52)
 May 2013 (49)
 April 2013 (67)
 March 2013 (74)
 February 2013 (63)
 January 2013 (62)
 December 2012 (62)
 November 2012 (66)
 October 2012 (68)
 September 2012 (48)
 August 2012 (75)
 July 2012 (60)
 June 2012 (71)
 May 2012 (69)
 April 2012 (85)
 March 2012 (86)
 February 2012 (90)
 January 2012 (81)
 December 2011 (103)
 November 2011 (118)
 October 2011 (74)
 September 2011 (2)
 June 2011 (110)
 May 2011 (118)
 April 2011 (111)
 March 2011 (112)
 February 2011 (101)
 January 2011 (119)
 December 2010 (117)
 November 2010 (118)
 October 2010 (131)
 September 2010 (117)
 August 2010 (226)
 July 2010 (351)
 June 2010 (305)
 May 2010 (319)
 April 2010 (343)
 March 2010 (329)
 February 2010 (311)
 January 2010 (312)
 December 2009 (266)
 November 2009 (156)
 July 2009 (101)
 June 2009 (279)
 May 2009 (365)
 April 2009 (348)
 March 2009 (347)
 February 2009 (323)
 January 2009 (318)
 December 2008 (237)
 November 2008 (155)
 October 2008 (334)
 September 2008 (310)
 August 2008 (343)
 July 2008 (362)
 June 2008 (322)
 May 2008 (464)
 April 2008 (1276)
 March 2008 (1658)
 February 2008 (250)
 January 2008 (6)
 November 2007 (1)
 September 2007 (1)
 June 2007 (1)
 May 2007 (1)
 March 2007 (1)
 January 2007 (2)
 December 2006 (1)
 October 2006 (2)
 September 2006 (1)
 August 2006 (2)

[GSoC] Templates in KDevelop – Week 5

System & Utilities

My last report (here) was full of pictures, but since then I’ve spent more time polishing the functionality, behind-the-scene improvements, and fixing bugs. However, the mid-term evaluation is approaching, so I think let everybody know what’s the state of things. I’m happy with my progress, my schedule was a bit vague, but I think I’m ahead of it. So far I’m still enjoying it, and I bought a more comfortable chair, so I have little problems with working long hours.

I split out some functionality to make code more modular, which also allowed me to write unit tests for much of the newly added classes. The main parts of the code (TemplateRenderer, TemplateClassGenerator and TemplatesModel) are covered with test cases.

Class Templates

My main focus was still on templates for creating new classes. I slowly decided on the variables passed to templates. They are also documented, and I think I can start writing more templates about now. The C++ plugin adds some variables of its own, such as namespaces,

Since KDevelop’s Declarations must always point to a location in a source file, they cannot be created directly, I had to add my own classes for describing code before it is generated. This way, data members of a class can be declared. These code description classes are very simple, with only a couple of members, and are written so that Grantlee templates have access to all their properties.

The state of template class generation is such that it covers all functionality of the existing “Create Class” dialog. I have already written a basic C++ template that produces the same output. Of course, it is possible to create different classes, such as ones with private pointers, QObject’s macros, or in different languages.

Writing the Class Templates

As I said, I already wrote a template for a basic C++ class, as well as one with a d-pointer. Since I figured a lot of the code would be shared between templates for the same language, I added some basic templates that can be included. These are for method declarations, argument lists, namespaces, include guards, and some other small conveniences. There is also a library of custom template filters in kdevplatform. The end result is that the templates themselves can be relatively small. I even reduces the amount of whitespace in the rendered output, so that templates can be more readable while the generated classes are compact enough.

However, I don’t think it’s practical to store templates and filters for all possible languages in kdevplatform. So I intend to add a way for templates to specify dependencies on language plugin. Of course, they could still be written from scratch, or simply ship with the needed includes. It is merely a convenience.

The plan is to have language plugins provide some of their own templates and filters, but so far they are only for C++.

Templates, Templates Everywhere

Of course, KDevelop has other utilities for code generation, and I figured templates would be useful there as well. I started with inserting API documentation. The previous implementation manually constructed a Doxygen C++ style comment. I replaced that with a renderer template, which now supports C++, Php and Python.

Pressing Alt-Shitf-D on a declaration of a C++ functions results in this

API documentation with Doxygen for C++

While doing the same thing on a Python function produces this

API documentation with reST for Python

Not only is it formatted in reST, the most common format for Python documentation, but it also is positioned below the declaration, as a true Python docstring. Obviously, we still need to convert __kdevpythondocumentation_builtin type names to python types, but stripping a prefix can be done within a template thanks to Grantlee’s built-in filters.


Разместил: Planet KDE | Дата: 28.06.2012 | Прочитано: 666 | Раздел: System & Utilities   

Рейтинг статьи

Средняя оценка: 0.00/0Средняя оценка: 0Всего голосов:0

Хорошо Нормально Пойдёт Плохо

Смотрите также связанные темы

08.07.2009 ...and Refactoring for All
Hello everybody, I should introduce myself first: I am Ramon Zarazua, I am a GSOC student working on C++ refacoring support for KDevelop.
22.11.2010 New articles published for week ending 11/20/2010
New articles published for week ending 11/20/2010 VMware ACE Moving an ACE Management Server to a new physical server without breaking the connection to deployed ACE instances (1030623) Date Published: 11/15/2010 Manually updating ACE Management Server information on a deployed ACE instance (1030649) Date Published: 11/15/2010 VMware ESX Clarification on VM Failover alarm trigger (1025755) Date Published: 11/16/2010 VMware ESX 4.1 Patch ESX410-201010402-SG: Updates GnuTLS, NSS, and openSSL (1027014) Date Published: 11/16/2010 VMware ESX 4.1 Patch ESX410-201010405-BG: Updates VMware Tools (...
17.01.2011 New Articles Published for Week of 1/15/2011
New Articles Published for Week of 1/15/2011 VMware ESX Unable to mount the CD/DVD-ROM drive inside a virtual machine (1031746) Date Published: 1/13/2011 vSphere Client reports the status of VMware Tools as Unmanaged (1032763) Date Published: 1/13/2011 Troubleshooting issues where Update Manager cannot remediate an ESX/ESXi host (1032707) Date Published: 1/11/2011 Root account permissions have been removed or misconfigured on an ESX host (1031192) Date Published: 1/13/2011 VMware ESXi Troubleshooting issues where Update Manager cannot upgrade an ESX/ESXi host (1032626) Date Published: 1/...
16.05.2011 New Articles Published for Week Ending 5/14/11
New Articles Published for Week Ending 5/14/11 VMware ACE Applying a policy update package in ACE fails with the error: Setup has detected that this ACE package requires a newer version of VMware Workstation (1038992) Date Published: 5/9/2011 VMware Converter Converting a physical or virtual machine with VMware Converter takes longer than expected (1038454) Date Published: 5/12/2011 Starting a virtual machine that was converted using VMware Converter fails with the error: STOP 0x79 MISMATCHED_HAL (1038576) Date Published: 5/11/2011 Unable to log in to a Windows virtual machine after it h...
25.10.2011 New Articles Published for Week Ending 10/22/11
New Articles Published for Week Ending 10/22/11 Apache HTTP Server Writing a support request for Apache HTTP Server (2003727) Date Published: 10/19/2011 VMware ESX Settings are lost after installing patch ESX410-201104001 on an ESX 4.1 Update1 host (2004745) Date Published: 10/20/2011 Hardware Status tab sensors are missing after applying Patch ESX410-201104401 (2005853) Date Published: 10/21/2011 NFS storage space details in vCenter Server appear blank (2007059) Date Published: 10/21/2011 Upgrading Cisco Nexus 1000V before upgrading to ESXi 5.0 (2007959) Date Published: 10/17/2011 Daylight...
22.11.2011 New Articles Published for Week Ending 11/19/11
New Articles Published for Week Ending 11/19/11 Apache HTTP Server Logging user defined cookies with Apache 2.0 and the usertrack module (2008211) Date Published: 11/14/2011 Checking the modules that are compiled into Apache HTTP Server and vFabric Enterprise Server (2009272) Date Published: 11/17/2011 Installing mod_fcgid on Apache HTTP Server 2.0.x configurations under Linux/Unix (2009475) Date Published: 11/17/2011 Apache Tomcat Setting up Tomcat in the Windows platform for monitoring by jconsole or jvisualvm (2008410) Date Published: 11/15/2011 Enabling garbage collection logging with T...
09.01.2012 New Articles Published for Week Ending 1/7/12
New Articles Published for Week Ending 1/7/12 Datacenter vCenter Protect Essentials and Essentials Plus FAQ (2010727) Date Published: 1/3/2012 VMware ESXInstalling VMware Tools on a Windows virtual machine fails with the the error: The Microsoft Runtime DLL installer failed to complete installation (2010644) Date Published: 1/6/2012 VMware ESXi An ESXi host halts and displays a purple diagnostic screen when using Network I/O Control with a Network Adapter that does not support VLAN Offload (2011474) Date Published: 1/6/2012 VMware Fusion Mac OS X dock process uses 100% CPU when Fusion is ru...
12.02.2011 VMmark 2.1 Released and Other News
VMmark 2.1 Released and Other News VMmark 2.1 has been released and is available here. We had a list of improvments to VMmark 2.0 even as we finished up the initial release of the benchmark last fall. Most of the changes are intended to improve usability, managability, and scale-out-ability of the benchmark. VMmark 2.0 has already generated tremendous interest from our partners and customers and we expect VMmark 2.1 to add to that momentum. Only the harness and vclient directories have been refreshed for VMware VMmark 2.1. The notable changes include the following: Uniform scaling of i...
30.10.2011 Top 5 Planet V12N blog posts for week 43
Top 5 Planet V12N blog posts for week 43 For those that might have missed it, check your iPad for an update to the VMware View client.  We released an update to the iPad client that is optimized for View 5, it supports running as a background process,  and brings a new look and feel to the connection manager among other features. Arne Fokkema - PowerCLI: Migrate templates during the Enter Maintenance Mode task - Normally when you put a host into Maintenance mode the templates will stay on the host instead of being migrate to a different host. This can be very annoying if you are p...
17.11.2011 A week in virtualization
A week in virtualization This week we released new versions of ThinApp, Horizon App Manager, and vCloud Connector. ThinApp 4.7 integrates with Horizon 1.2 now, to allow you to easily manage your virtualized applications on Windows. The new capabilities include dynamic entitlements, secure single sign-on, a management interface, and monitoring and reporting. The new vCloud Connector 1.5 will help you transfer workloads between clouds more reliably and efficiently.  Users can now view VMs and templates across multiple clouds and perform basic operations through a new Web-based UI of vcl...
Нет комментариев. Почему бы Вам не оставить свой?
Вы не можете отправить комментарий анонимно, пожалуйста зарегистрируйтесь.
Google Search


Топ Новостей
1: Fedora and KDE/spin\'s treatment - Discussion
Просмотров - 2984

2: Offline Vaults for an extra layer of protection
Просмотров - 758

3: KDE\'s Kirigami 2.0 Framework for Convergent UIs Enters Beta with New Features
Просмотров - 739

4: Akonadi/KMail issues on Tumbleweed?
Просмотров - 672

5: Netrunner Desktop 16.09 "Avalon" Linux OS Is Out with Kernel 4.7, KDE Plasma 5.7
Просмотров - 645

6: KDevelop 5.0.2 released for Windows and Linux
Просмотров - 637

7: Debugging issues booting a PC in 2018
Просмотров - 636

8: plib3.gui 0.9.9
Просмотров - 602

9: Konstruct
Просмотров - 596

10: Best Desktop Environment
Просмотров - 580

11: KDE Connect – State of the union
Просмотров - 572

12: KDE Connect Sprint
Просмотров - 571

13: Multi-screen woes in Plasma 5.7
Просмотров - 571

14: Come dine with the KDE e.V. board in Berlin in October
Просмотров - 569

15: Help Canonical Test GNOME Patches, Android Apps Illegally Tracking Kids, MySQL 8.0 Released and More
Просмотров - 559

Google 120X240

Главная | Actual Topics | Статьи | Обратная связь | Guest Book
Генерация: 1.634 сек. и 13 запросов к базе данных за 1.568 сек.
Powered by SLAED CMS © 2005-2007 SLAED. All rights reserved.