buena tarde<div>estoy dando soporte a una aplicacion desarrollada  en c++ que se conecta a un disposito serial.</div><div>tengo ploblemas al compilarlo porque me pide la biblioteca ( compplib.hpp )</div><div><br></div><div>
por favor les pido su gran colaboracion</div><div><br></div><div>Cordialmente</div><div><br></div><div>Andres Rodriguez</div><div><br><br><div class="gmail_quote">El 5 de febrero de 2013 12:02, victor Gonyi <span dir="ltr"><<a href="mailto:mrpiperoman@hotmail.com" target="_blank">mrpiperoman@hotmail.com</a>></span> escribió:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr">
Buenos días.<br><br>He de reconocer que soy un adicto a los Cheat sheet cuando tengo que manejar una librería o programa. Por ejemplo openCV o VIM (Buscad en google si no sabeis a lo que me refiero). Una cosa que he echado de menos en C++ con clase (O al menos no he encontrado) es una hoja por las 2 caras con una serie de convenciones para programar en grupos de varias personas y no morir en el intento.<br>
<br>Cada uno tiene sus manías, pero me parece importante, cuando trabajas con otras personas, tener una serie de estándares que seguir para que el código sea lo más homogéneo y limpio posible. He empezado a crear una Cheat Sheet lo más básica posible, estoy intentando conseguir más protocolos o normas, pero quiero hacerla lo más sencilla posible y escribirla en Látex.<br>
<br>Si teneis buenas costumbres y quereis compartirlas estoy abierto a sugerencias.<br><br>De momento este es el borrador que tengo preparado:<br><br>------------------------------------------------------------------------------------------------------------------------------------------------<br>
<br>


        
        
        
        


<p style="margin-bottom:0cm">Cheat Sheet Programmers</p>
<p style="margin-bottom:0cm"><br>
</p>
Remember:<br>
<ul><li><p style="margin-bottom:0cm">Code should be locally coherent
        and single-functioned: One function should do exactly one thing. It
        should be clear about what it's doing. 
        </p>
        </li><li><p style="margin-bottom:0cm">Local code should explain, or at
        least hint at the overall system design. 
        </p>
        </li><li>Code should be self-documenting. Comments should be avoided
        whenever possible. Comments duplicate work when both writing and
        reading code. If you need to comment something to make it
        understandable it should probably be rewritten. 
        <br>
</li></ul>
<p style="margin-bottom:0cm">Palabras clave:</p>
<p style="margin-bottom:0cm">- TODO: Código que necesita mejora</p>
<p style="margin-bottom:0cm">- FIXME: Indica fragmento de código
con bug</p>
<p style="margin-bottom:0cm">- WORKAROUND: Arreglando bug en la zona
para evitar conflictos</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm">Files</p>
<p style="margin-bottom:0cm">- .h: Headers</p>
<p style="margin-bottom:0cm">- .cpp: Source</p>
<p style="margin-bottom:0cm">- .hpp: Template</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm">Variables:</p>
<p style="margin-bottom:0cm">- Prefijo: m_ si son variables miembro.</p>
<p style="margin-bottom:0cm">- Nombre descriptivo: Para saber que
hace sin necesidad de comentario.</p>
<p style="margin-bottom:0cm">- Usar Mayúsculas cada nueva palabra.</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm">Ejemplo: m_ContadorVisitas</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm">Directorios: 
</p>
<p style="margin-bottom:0cm">- trunk: Línea general de desarrollo.
Siempre debe compilar</p>
<p style="margin-bottom:0cm">- branches: Copias del trunk para
experimentos o cambios importantes</p>
<p style="margin-bottom:0cm">- tag: Versiones estables</p>
<p style="margin-bottom:0cm">- resources: Guardar todo archivo común
a todas las líneas de desarrollo. Por ejemplo modelos 3D o imagenes.</p>
<p style="margin-bottom:0cm">- 3rdParty: Todas las dependencias
externas.</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm">Compilación:</p>
<p style="margin-bottom:0cm">- Script general multiplataforma</p>
<p style="margin-bottom:0cm">- Variables de entorno en script y no
ordenador. Usa un CMAKE que pida esos datos.</p>
<p style="margin-bottom:0cm">- Referencias relativas dentro del
proyecto con las variables dadas a CMAKE</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm">Includes:</p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">Todo
include debe usar </span></strong><strong><chevron_brackets></strong></p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">Usa
“Comillas” solo si el include está en el mismo directorio.</span></strong></p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">Clases:</span></strong></p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">-
Los nombres empiezan siempre por mayúscula.</span></strong></p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">P.E:
class MyNuevaClase;</span></strong></p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">Constantes:
</span></strong>
</p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">-
Toda constante siempre en mayúsculas.</span></strong></p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">P.E:
const static int SIZE_HEIGHT = 1024;</span></strong></p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">Paréntesis:
</span></strong>
</p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">-
Siempre en una línea nueva</span></strong></p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">P.E:</span></strong></p>
<p style="margin-bottom:0cm"><br>
</p>
<pre><strong><span style="font-weight:normal">if (a < b)</span></strong>
{
  ...
}
else
{
  ...
}</pre><p style="margin-bottom:0cm">
<br>
</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">Macros:</span></strong></p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">Toda
macro siempre TODO_MAYUSCULAS_CON_BARRABAJA</span></strong></p>
<p style="margin-bottom:0cm"><br>
</p>
<pre><strong><span style="font-weight:normal">#ifndef </span></strong><strong><span style="font-weight:normal">GAMEMANAGER</span></strong><strong><span style="font-weight:normal">_</span></strong><strong><span style="font-weight:normal">H_</span></strong>
#define VERSION 0.0

// the code

#endif // <strong><span style="font-weight:normal">GAMEMANAGER</span></strong><strong><span style="font-weight:normal">_</span></strong><strong><span style="font-weight:normal">H_</span></strong></pre><p style="margin-bottom:0cm">

<br>
</p>
<p style="margin-bottom:0cm"><strong><span style="font-weight:normal">Defines:</span></strong></p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm">Convenciones:</p>
<p style="margin-bottom:0cm">- Multiplataforma: Trata de seguir los
estándares de programación.</p>
<p style="margin-bottom:0cm">- Const: Usa constantes para variables
y funciones siempre que puedas. 
</p>
<p style="margin-bottom:0cm">- Minimiza los comentarios: Los nombres
descriptivos de por si no hace falta explicarlos. Las tareas
complejas si.</p>
<p style="margin-bottom:0cm">- Tabulación y espaciado: Emplea un
espaciado coherente.</p>
<p style="margin-bottom:0cm">- Usa siempre llaves en una línea
nueva</p>
<p style="margin-bottom:0cm">- Encapsulado I: Devuelve referencias y
no punteros.</p>
<p style="margin-bottom:0cm">- Encapsulado II: Usa variables
privadas, usa getters y setters para ver/editar las accesibles.</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm">Debuging Android:</p>
<pre><code>#include <android/log.h></code>
<code>#define  LOG_TAG    "foo"</code>
<code>#define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)</code></pre><p style="margin-bottom:0cm">
<br>
</p>
<p style="margin-bottom:0cm">Patrones de diseño:</p>
<p style="margin-bottom:0cm">Utilizalos solo cuando sea necesario.</p>
<p style="margin-bottom:0cm">- Singleton: Cuando sea una estructura
general que necesite ser accedida desde cualquier punto y siempre
este en memoria.</p>
<p style="margin-bottom:0cm">- Factory: Construcción de clases
usando una serie de métodos predefinidos</p>
<p style="margin-bottom:0cm">- Facade: Reducción de complejidad
usando una serie de módulos y protección contra ingeniería
inversa.</p>
<p style="margin-bottom:0cm">Documentar para Doxygen:</p>
<p style="margin-bottom:0cm">H</p>
<p style="margin-bottom:0cm">- Versión resumida de cada explicación
para que sea usada desde el exterior.</p>
<p style="margin-bottom:0cm">CPP</p>
<p style="margin-bottom:0cm">- Comenta cada función usando:</p>
<p style="margin-bottom:0cm">/**</p>
<p style="margin-bottom:0cm"> *</p>
<p style="margin-bottom:0cm"> */</p>
<p style="margin-bottom:0cm">- Añade los campos que necesites.
Obligatorio brief , params y una pequeña descripción.</p>
<p style="margin-bottom:0cm">- /brief Titulo o breve resumen de la
función</p>
<p style="margin-bottom:0cm">- Descripción</p>
<p style="margin-bottom:0cm">- /param[in] Un parámetro de entrada
por línea</p>
<p style="margin-bottom:0cm">- /param[out] Un parámetro de salida
por línea.</p>
<p style="margin-bottom:0cm">- /author Solo 1 por clase</p>
<p style="margin-bottom:0cm">- /bug Si tiene un bug la función
especificar</p>
<p style="margin-bottom:0cm">- /version Version de la función</p>
<p style="margin-bottom:0cm">- /warning Indicar si hay que tener
cuidado, por ejemplo si será deprecated.</p>
<p style="margin-bottom:0cm">- /see Referencia a algo importante</p>
<p style="margin-bottom:0cm">- /image Para añadir una imagen</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm">Dependencias:</p>
<p style="margin-bottom:0cm">- Especifica que librerías necesitas y
su versión en un README.txt</p>
<p style="margin-bottom:0cm"><br></p><p style="margin-bottom:0cm">------------------------------------------------------------------------------------------------------------------------------------------------------------------
</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm">Recursos recomendables :</p>
<p style="margin-bottom:0cm">Usar Patrones de diseño:
<a href="http://en.wikibooks.org/wiki/C%2B%2B_Programming/Code/Design_Patterns" target="_blank">http://en.wikibooks.org/wiki/C%2B%2B_Programming/Code/Design_Patterns</a></p>
<p style="margin-bottom:0cm">Usar STL:
<a href="http://www.sgi.com/tech/stl/table_of_contents.html" target="_blank">http://www.sgi.com/tech/stl/table_of_contents.html</a></p>
<p style="margin-bottom:0cm">Libros de C++ a tener en cuenta:
Effective C++ , More Effective C++, Effective STL de Scott Meyers.</p>
<p style="margin-bottom:0cm">Otros:
<a href="http://kotaku.com/5975610/the-exceptional-beauty-of-doom-3s-source-code" target="_blank">http://kotaku.com/5975610/the-exceptional-beauty-of-doom-3s-source-code</a></p>

<br>------------------------------------------------------------------------------------------------------------------------------------------------------------------<br><br>Cualquier comentario es bienvenido.<br><br>Un saludo.<br>
                                          </div></div>
<br>_______________________________________________<br>
Lista de correo Cconclase <a href="mailto:Cconclase@listas.conclase.net">Cconclase@listas.conclase.net</a><br>
<a href="http://listas.conclase.net/mailman/listinfo/cconclase_listas.conclase.net" target="_blank">http://listas.conclase.net/mailman/listinfo/cconclase_listas.conclase.net</a><br>
Bajas: <a href="http://listas.conclase.net/index.php?gid=2&mnu=FAQ" target="_blank">http://listas.conclase.net/index.php?gid=2&mnu=FAQ</a><br></blockquote></div><br></div>